.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg .glow { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.5; }
.bg .g1 { width: 56vw; height: 56vw; left: -16vw; top: -26vw; background: var(--accent-deep); animation: driftA 26s ease-in-out infinite alternate; }
.bg .g2 { width: 44vw; height: 44vw; right: -14vw; bottom: -22vw; background: rgba(var(--accent-rgb), 0.35); opacity: 0.25; animation: driftB 30s ease-in-out infinite alternate; }
.bg .grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(ellipse at 50% 18%, #000 0%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse at 50% 18%, #000 0%, transparent 70%); }
@keyframes driftA { to { transform: translate(6vw, 4vw); } }
@keyframes driftB { to { transform: translate(-5vw, -3vw); } }

.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 20px; padding: 14px max(24px, calc((100vw - 1120px) / 2)); background: linear-gradient(to bottom, rgba(7, 9, 12, 0.9) 60%, rgba(7, 9, 12, 0)); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.brand b { color: var(--accent); font-weight: 700; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { padding: 8px 12px; white-space: nowrap; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 600; transition: color 140ms ease, background 140ms ease; }
.nav-links a:hover { color: var(--text); background: rgba(var(--accent-rgb), 0.1); }
.nav-user { display: flex; }

main { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }

.hero { padding: 84px 0 70px; text-align: center; }
.eyebrow { color: var(--accent-text); font-size: 12px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; }
.hero h1 { max-width: 860px; margin: 18px auto 0; font-family: var(--font-display); font-size: clamp(30px, 5.4vw, 58px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.lead { max-width: 640px; margin: 22px auto 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.hero > * { animation: rise 640ms var(--ease) both; }
.hero > :nth-child(2) { animation-delay: 70ms; }
.hero > :nth-child(3) { animation-delay: 140ms; }
.hero > :nth-child(4) { animation-delay: 210ms; }
.hero > :nth-child(5) { animation-delay: 280ms; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 44px auto 0; max-width: 1040px; text-align: left; }
.act { position: relative; display: flex; align-items: center; gap: 16px; padding: 20px 22px; border: 1px solid var(--line-2); border-radius: 18px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; overflow: hidden; transition: border-color 180ms ease, background 180ms ease, transform 200ms var(--ease), box-shadow 220ms ease; }
.act::before { content: ''; position: absolute; inset: 0; background: radial-gradient(260px circle at var(--mx, 100%) var(--my, 0%), rgba(var(--accent-rgb), 0.18), transparent 70%); opacity: 0; transition: opacity 220ms ease; }
.act:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 18px 40px -22px rgba(var(--accent-rgb), 0.6); }
.act:hover::before { opacity: 1; }
.act:active { transform: translateY(-1px) scale(0.99); }
.act.primary { background: linear-gradient(150deg, rgba(var(--accent-rgb), 0.2), var(--surface) 70%); border-color: rgba(var(--accent-rgb), 0.5); }
.act-ico { position: relative; display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; border: 1px solid var(--line-3); border-radius: 13px; background: rgba(var(--accent-rgb), 0.1); color: var(--accent); }
.act.primary .act-ico { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.act-ico svg { width: 23px; height: 23px; }
.act-t { position: relative; display: grid; gap: 2px; min-width: 0; }
.act-t b { font-size: 16px; font-weight: 800; }
.act-t small { color: var(--muted); font-size: 13px; }
.act-go { position: relative; margin-left: auto; color: var(--muted); transition: transform 200ms ease, color 200ms ease; }
.act-go svg { width: 18px; height: 18px; display: block; }
.act:hover .act-go { transform: translateX(4px); color: var(--accent); }
.hint { max-width: 560px; margin: 22px auto 0; color: var(--muted); font-size: 13px; line-height: 1.6; text-wrap: balance; }

.block { padding: 56px 0; }
.block-head { display: grid; gap: 10px; margin-bottom: 28px; }
.block-head h2 { font-family: var(--font-display); font-size: clamp(22px, 3vw, 32px); font-weight: 700; letter-spacing: -0.02em; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.card { display: grid; align-content: start; gap: 12px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); transition: border-color 180ms ease, transform 200ms var(--ease); }
.card:hover { border-color: var(--line-3); transform: translateY(-2px); }
.card-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(var(--accent-rgb), 0.12); color: var(--accent); }
.card-ico svg { width: 22px; height: 22px; }
.card h3 { font-size: 17px; font-weight: 800; }
.card p { color: var(--muted); font-size: 14.5px; line-height: 1.65; }

.steps { list-style: none; display: grid; gap: 12px; }
.steps li { display: flex; gap: 20px; align-items: flex-start; padding: 22px 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.num { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border: 1px solid rgba(var(--accent-rgb), 0.5); border-radius: 12px; background: rgba(var(--accent-rgb), 0.12); color: var(--accent-soft); font-family: var(--font-display); font-weight: 700; }
.steps h3 { font-size: 16.5px; font-weight: 800; margin-bottom: 4px; }
.steps p { color: var(--muted); font-size: 14.5px; line-height: 1.65; }

.faq { display: grid; gap: 14px; width: 100%; margin: 0 auto; }
.faq details { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); transition: border-color 160ms ease; }
.faq details[open] { border-color: rgba(var(--accent-rgb), 0.45); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 32px; font-size: 18px; font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex-shrink: 0; color: var(--accent); font-size: 28px; line-height: 1; transition: transform 200ms ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 32px 26px; color: var(--muted); font-size: 16px; line-height: 1.7; }

.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; width: min(1120px, calc(100% - 48px)); margin: 24px auto 0; padding: 26px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot a { color: var(--accent-text); }
.foot a:hover { text-decoration: underline; }

.rv { opacity: 0; transform: translateY(18px); transition: opacity 560ms var(--ease), transform 560ms var(--ease); }
.rv.in { opacity: 1; transform: none; }
.cards .rv:nth-child(2) { transition-delay: 70ms; }
.cards .rv:nth-child(3) { transition-delay: 140ms; }

@media (max-width: 900px) {
  .actions, .cards { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
  .nav-links { display: none; }
  .nav-user { margin-left: auto; }
  .hero { padding: 56px 0 48px; }
}
@media (max-width: 520px) {
  .nav { padding: 12px 16px; }
  .brand span { font-size: 14px; }
  main { width: calc(100% - 32px); }
  .steps li { padding: 18px; gap: 14px; }
  .faq summary { padding: 20px; font-size: 16px; }
  .faq details p { padding: 0 20px 20px; font-size: 15px; }
}

.nav-user { display: flex; align-items: center; gap: 10px; }
.hint-link { display: block; margin-top: 10px; color: var(--accent-text); font-weight: 700; }
.hint-link:hover { text-decoration: underline; }

/* Новости: объявления руководства */
.news { display: grid; gap: 14px; }
.news-empty { padding: 28px; border: 1px dashed var(--line-2); border-radius: 18px; color: var(--muted); text-align: center; }
.news-item { display: grid; gap: 12px; padding: 24px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.news-item header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.news-tag { padding: 4px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 800; }
.news-tag.cyber { background: rgba(var(--accent-rgb), 0.16); color: var(--accent-soft); }
.news-tag.ann { background: rgba(224, 168, 74, 0.16); color: #f0c97c; }
.news-item time { color: var(--muted); font-size: 13px; }
.news-body { display: grid; gap: 8px; font-size: 15.5px; line-height: 1.7; overflow-wrap: anywhere; }
.news-body h4 { font-size: 18px; }
.news-body small { color: var(--muted); font-size: 13px; }
.news-body a { color: var(--accent-text); text-decoration: underline; }
.news-item footer { color: var(--muted); font-size: 13px; font-weight: 700; }
@media (max-width: 520px) { .news-item { padding: 18px; } }

/* шапка: всё в одну строку; когда не помещается — ссылки прячутся, остаются логотип и вход */
.brand { flex-shrink: 0; white-space: nowrap; }
.brand span { display: flex; gap: 6px; }
.nav-user { flex-shrink: 0; white-space: nowrap; }
.nav-user .btn, .nav-user .user-chip { white-space: nowrap; }
@media (max-width: 1100px) {
  .nav-links { display: none; }
  .nav-user { margin-left: auto; }
}
@media (max-width: 520px) { .brand span { flex-direction: column; gap: 0; line-height: 1.15; } }

/* телефон: у ника остаётся только аватар, кнопка компактнее, на самых узких экранах — один логотип без названия */
@media (max-width: 520px) {
  .nav { gap: 10px; padding: 10px 14px; }
  .nav-user { gap: 8px; }
  .nav-user .user-chip { padding: 3px; min-height: 40px; }
  .nav-user .user-chip span { display: none; }
  .nav-user .btn { padding: 0 12px; font-size: 12.5px; }
  .brand { gap: 9px; }
  .brand span { font-size: 13px; }
}
@media (max-width: 380px) { .brand span { display: none; } }

/* ===== Оформление и анимации главной ===== */

/* фон: сетка медленно плывёт, свечение дышит */
.bg .grid { animation: gridDrift 48s linear infinite; }
@keyframes gridDrift { to { background-position: 56px 56px, 56px 56px; } }
.bg .g2 { animation: driftB 30s ease-in-out infinite alternate, glowBreath 9s ease-in-out infinite; }
@keyframes glowBreath { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.34; } }

/* шапка: при прокрутке получает границу и плотный фон, снизу полоса прогресса чтения */
.nav { transition: background 260ms ease, box-shadow 260ms ease; }
.nav.scrolled { background: rgba(7, 9, 12, 0.86); box-shadow: 0 1px 0 var(--line); }
.nav::after { content: ''; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transform: scaleX(var(--p, 0)); transform-origin: left; pointer-events: none; }
.nav-links a { position: relative; }
.nav-links a::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform 220ms var(--ease); }
.nav-links a:hover::after { transform: scaleX(1); }

/* заголовок: лёгкий градиент по тексту */
.hero h1 { background: linear-gradient(180deg, #fff 35%, var(--accent-soft) 140%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* главная кнопка «Войти в кабинет» мягко подсвечивается, пока на неё не навели */
.act.primary { animation: glowPulse 3.6s ease-in-out 1.2s infinite; }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); } 50% { box-shadow: 0 0 0 7px rgba(var(--accent-rgb), 0.09); } }
.act-ico { transition: transform 260ms var(--ease), background 180ms ease; }
.act:hover .act-ico { transform: rotate(-7deg) scale(1.08); }

/* подсветка под курсором для карточек (класс .spot ставит landing.js) */
.spot { position: relative; }
.spot::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--accent-rgb), 0.11), transparent 62%); opacity: 0; transition: opacity 240ms ease; pointer-events: none; }
.spot:hover::after { opacity: 1; }

/* подъём при наведении: свойство translate не перебивается анимацией появления */
.card, .steps li, .news-item { transition: border-color 180ms ease, translate 260ms var(--ease), opacity 560ms var(--ease), transform 560ms var(--ease); }
.card:hover, .steps li:hover, .news-item:hover { translate: 0 -3px; border-color: var(--line-3); }
.card-ico { transition: transform 280ms var(--ease), background 180ms ease; }
.card:hover .card-ico { transform: scale(1.1) rotate(-5deg); background: rgba(var(--accent-rgb), 0.2); }
.num { transition: background 200ms ease, color 200ms ease, transform 260ms var(--ease); }
.steps li:hover .num { background: var(--accent); color: var(--on-accent); transform: scale(1.08); }

/* появление при прокрутке: задержку по порядку задаёт landing.js */
.rv { transition-delay: var(--d, 0ms); }

/* вопросы: ответ выезжает, заголовок подсвечивается */
.faq summary { transition: color 160ms ease; }
.faq summary:hover { color: var(--accent-soft); }
.faq details[open] p { animation: faqIn 340ms var(--ease) both; }
@keyframes faqIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* новости: карточки выезжают по очереди */
.news-item { animation: rise 520ms var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
.news-tag { transition: transform 200ms var(--ease); }
.news-item:hover .news-tag { transform: scale(1.05); }
