/* ═══════════════════════════════════════════════════════════
   ЛЕНДИНГ · иммерсивная сцена в духе activetheory.net
   Палитра Норникеля: глубокий космос + синий #0077C8 + лёд #00E5FF
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #04070D;
  --ink: #EAF2FF;
  --dim: #7E8CA6;
  --blue: #0077C8;
  --cyan: #00E5FF;
  --display: 'Unbounded', sans-serif;
  --body: 'Onest', system-ui, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  color-scheme: dark;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  overflow-y: auto;   /* прокрутка появляется только если контент не влез */
}

::selection { background: rgba(0, 229, 255, .3); }

svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── фон ── */

#gl, #bg {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
}
#gl { z-index: 0; }
#bg { z-index: 1; }

.grain {
  position: fixed; inset: -50%;
  pointer-events: none;
  z-index: 3;
  opacity: .16;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  animation: grainShift 1.2s steps(3) infinite;
}
@keyframes grainShift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(1%, -2%); }
}

/* ── HUD по углам ── */

.hud {
  position: fixed; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  gap: 40px;
  padding: 26px 34px;
  z-index: 10;
  font: 600 11px var(--mono);
  letter-spacing: .18em;
  color: var(--dim);
  text-transform: uppercase;
  pointer-events: none;
}
.hud--top { top: 0; background: linear-gradient(180deg, rgba(4, 7, 13, .8), transparent); }
.hud--bottom { bottom: 0; background: linear-gradient(0deg, rgba(4, 7, 13, .85), transparent); }

.hud__brand { display: flex; align-items: center; gap: 10px; color: #B9C8E4; }
.hud__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: dotPulse 2.6s infinite;
}
@keyframes dotPulse { 50% { opacity: .35; } }

.hud__ticker { font-variant-numeric: tabular-nums; }
.hud__ver { text-align: right; flex: none; }

/* ── сцена ── */

.stage {
  position: relative;
  z-index: 5;
  height: auto;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 90px 24px;
  gap: 0;
}

.stage__eyebrow {
  font: 600 11.5px var(--mono);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--cyan);
  opacity: 0;
  animation: rise .9s .15s ease forwards;
}

.stage__title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(42px, 8.5vw, 108px);
  line-height: 1.02;
  letter-spacing: .01em;
  margin: 18px 0 22px;
  will-change: transform;
}
.stage__line { display: block; opacity: 0; animation: rise 1s .3s cubic-bezier(.2,.8,.25,1) forwards; }
.stage__line--accent {
  animation-delay: .45s;
  background: linear-gradient(100deg, #FFFFFF -10%, var(--cyan) 35%, var(--blue) 80%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 34px rgba(0, 170, 255, .35));
}

.stage__sub {
  font-size: 15.5px;
  line-height: 1.7;
  color: #A9B7D2;
  opacity: 0;
  animation: rise .9s .6s ease forwards;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

/* ── карточки ролей ── */

.roles {
  display: flex; gap: 18px; flex-wrap: wrap; justify-content: center;
  margin-top: 44px;
}

.role-card {
  width: 280px;
  padding: 26px 26px 22px;
  text-align: left;
  color: var(--ink);
  font-family: var(--body);
  display: flex; flex-direction: column; gap: 8px;
  opacity: 0;
  animation: rise .9s ease forwards;
}
.role-card:nth-child(1) { animation-delay: .75s; }
.role-card:nth-child(2) { animation-delay: .88s; }
.role-card:nth-child(3) { animation-delay: 1.01s; }

.role-card__icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 15px;
  margin-bottom: 8px;
  background: rgba(0, 190, 255, .12);
  color: var(--cyan);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
}
.role-card__icon svg { width: 22px; height: 22px; }
.role-card__icon--admin { background: rgba(0, 119, 200, .18); color: #6FC4FF; }
.role-card__icon--lead  { background: rgba(45, 212, 191, .13); color: #2DD4BF; }

.role-card b { font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.role-card span { font-size: 13px; line-height: 1.55; color: var(--dim); }
.role-card em {
  margin-top: 14px;
  font: 700 12px var(--mono);
  letter-spacing: .14em; text-transform: uppercase; font-style: normal;
  color: var(--cyan);
  display: flex; align-items: center; gap: 7px;
}
.role-card em i { font-style: normal; transition: transform .3s; }
.role-card:hover em i { transform: translateX(5px); }

/* ── демо-ссылка ── */

.demo-link {
  margin-top: 30px;
  background: none; border: 0;
  font: 500 13.5px var(--body);
  color: var(--dim);
  cursor: pointer;
  opacity: 0;
  animation: rise .9s 1.05s ease forwards;
  transition: color .25s;
}
.demo-link u {
  color: #9fd8ff;
  text-underline-offset: 4px;
  text-decoration-color: rgba(0, 190, 255, .4);
}
.demo-link:hover { color: #C7D6EF; }
.demo-link:hover u { color: var(--cyan); }

/* ── подпись команды ── */

.credit {
  margin-top: 34px;
  font: 600 10px var(--mono);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #56637E;
  opacity: 0;
  animation: rise .9s 1.2s ease forwards;
}
.credit b {
  font-weight: 600;
  background: linear-gradient(100deg, #9FD8FF, var(--cyan));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ── модальное окно входа ── */

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(2, 5, 11, .6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal__glass {
  position: relative;
  width: min(420px, calc(100vw - 40px));
  padding: 34px 34px 28px;
  border-radius: 28px;
  cursor: default;
  animation: modalIn .45s cubic-bezier(.2, .9, .3, 1.1);
}
.modal__glass:hover { transform: none; }
@keyframes modalIn { from { opacity: 0; transform: translateY(30px) scale(.96); } }

.modal__close {
  position: absolute; top: 16px; right: 18px;
  background: none; border: 0;
  color: var(--dim); font-size: 15px;
  cursor: pointer; padding: 6px;
  transition: color .2s;
}
.modal__close:hover { color: var(--ink); }

.modal__kicker {
  font: 600 10.5px var(--mono);
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--cyan);
}
.modal__glass h2 {
  font-family: var(--display);
  font-size: 22px; font-weight: 700;
  margin: 10px 0 22px;
}

.field { display: block; text-align: left; margin-bottom: 16px; }
.field span {
  display: block;
  font: 600 11.5px var(--body);
  letter-spacing: .04em;
  color: var(--dim);
  margin-bottom: 8px;
}
.field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(160, 200, 255, .16);
  background: rgba(4, 9, 18, .55);
  color: var(--ink);
  font: 500 14.5px var(--body);
  outline: none;
  transition: border-color .2s, box-shadow .25s;
}
.field input:focus {
  border-color: rgba(0, 200, 255, .55);
  box-shadow: 0 0 0 4px rgba(0, 190, 255, .1);
}
.field input::placeholder { color: #536080; }

.modal__submit { width: 100%; justify-content: center; font-size: 14.5px; }

.modal__hint {
  margin-top: 18px;
  font-size: 11.5px; line-height: 1.6;
  color: var(--dim);
}
.modal__hint code {
  font-family: var(--mono); font-size: 10.5px;
  color: #8fd4ff;
  background: rgba(0, 150, 230, .1);
  padding: 1px 6px; border-radius: 6px;
}

/* ── переключатель темы (в верхнем HUD) ── */

.hud__side { display: flex; align-items: center; gap: 16px; }

.theme-toggle {
  pointer-events: auto;
  width: 40px; height: 40px;
  border-radius: 13px;
  display: grid; place-items: center;
  color: var(--dim);
}
.theme-toggle:hover { color: var(--cyan); }
.theme-toggle svg { width: 18px; height: 18px; }
.ico-moon { display: none; }
html[data-theme="light"] .ico-sun { display: none; }
html[data-theme="light"] .ico-moon { display: block; }

/* ═══ СВЕТЛАЯ ТЕМА · мята + фиолет AI Science Hack ═══ */

html[data-theme="light"] {
  --bg: #EFFAF4;
  --ink: #1D2140;
  --dim: #5A6480;
  --blue: #5B2FD1;
  --cyan: #009E76;
  color-scheme: light;
}

html[data-theme="light"] .grain { opacity: .05; }

html[data-theme="light"] .hud--top { background: linear-gradient(180deg, rgba(239, 250, 244, .85), transparent); }
html[data-theme="light"] .hud--bottom { background: linear-gradient(0deg, rgba(239, 250, 244, .9), transparent); }
html[data-theme="light"] .hud__brand { color: #3A4066; }
html[data-theme="light"] .hud__dot { background: #00D9A0; box-shadow: 0 0 12px rgba(0, 217, 160, .8); }

html[data-theme="light"] .stage__line--accent {
  background: linear-gradient(100deg, #4B23C8 5%, #7A4BFF 45%, #00C490 95%);
  -webkit-background-clip: text; background-clip: text;
  filter: drop-shadow(0 0 30px rgba(91, 47, 209, .18));
}
html[data-theme="light"] .stage__sub { color: #55608A; }

html[data-theme="light"] .role-card__icon { background: rgba(0, 217, 160, .16); color: #00A87C; }
html[data-theme="light"] .role-card__icon--admin { background: rgba(91, 47, 209, .1); color: #5B2FD1; }
html[data-theme="light"] .role-card__icon--lead { background: rgba(0, 160, 190, .1); color: #0090A8; }

html[data-theme="light"] .demo-link u { color: #5B2FD1; text-decoration-color: rgba(91, 47, 209, .35); }
html[data-theme="light"] .demo-link:hover u { color: #4B23C8; }

html[data-theme="light"] .credit { color: #8B93AC; }
html[data-theme="light"] .credit b {
  background: linear-gradient(100deg, #5B2FD1, #00B487);
  -webkit-background-clip: text; background-clip: text;
}

html[data-theme="light"] .modal__backdrop { background: rgba(230, 244, 238, .55); }
html[data-theme="light"] .field input {
  background: rgba(255, 255, 255, .75);
  border-color: rgba(70, 45, 170, .18);
  color: var(--ink);
}
html[data-theme="light"] .field input:focus {
  border-color: rgba(91, 47, 209, .55);
  box-shadow: 0 0 0 4px rgba(91, 47, 209, .09);
}
html[data-theme="light"] .field input::placeholder { color: #9AA2B8; }
html[data-theme="light"] .modal__hint code {
  color: #5B2FD1;
  background: rgba(91, 47, 209, .08);
}

/* ── адаптив ── */

@media (max-width: 720px) {
  body { overflow-y: auto; overflow-x: hidden; }
  .stage {
    min-height: 100vh;
    min-height: 100svh;
    padding: 88px 18px 104px;
  }
  .stage__title { font-size: clamp(36px, 12vw, 64px); }
  .stage__sub { font-size: 13.5px; }

  /* карточки ролей — компактные горизонтальные, стекло и анимации те же */
  .roles { flex-direction: column; width: 100%; max-width: 420px; gap: 12px; margin-top: 34px; }
  .role-card {
    width: 100%;
    display: grid;
    grid-template-columns: 46px 1fr;
    grid-template-rows: auto auto;
    column-gap: 16px; row-gap: 3px;
    align-items: center;
    padding: 18px 54px 18px 18px;
  }
  .role-card__icon { grid-row: 1 / span 2; margin: 0; }
  .role-card b { font-size: 15.5px; }
  .role-card span { font-size: 12px; }
  .role-card em {
    position: absolute; right: 18px; top: 50%;
    transform: translateY(-50%);
    margin: 0; font-size: 0;           /* прячем слово «Войти», оставляем стрелку */
  }
  .role-card em i { font-size: 20px; }

  .demo-link { margin-top: 24px; }

  .hud { padding: 18px; }
  .hud__tag, .hud__ver { display: none; }
  .hud--bottom { justify-content: center; }
  .hud__ticker { font-size: 9.5px; letter-spacing: .12em; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .stage__eyebrow, .stage__line, .stage__sub, .role-card, .demo-link { animation-duration: .01s; animation-delay: 0s; }
}
