/* ============================================================
   KAK Client — стили
   ============================================================ */

/* ---------- Переменные ---------- */
:root {
  --bg:            #07060d;
  --text:          #ece9f7;
  --muted:         #9b95b8;

  --violet:        #a855f7;
  --indigo:        #6366f1;
  --cyan:          #22d3ee;
  --pink:          #f472b6;

  --line:          rgba(255, 255, 255, .08);
  --line-strong:   rgba(168, 85, 247, .38);
  --glass:         rgba(16, 12, 28, .55);

  --r-lg:          26px;
  --r-md:          18px;
  --r-sm:          12px;

  --container:     1120px;
  --header-h:      68px;

  --font: "Inter", "Manrope", -apple-system, BlinkMacSystemFont,
          "Segoe UI", "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ---------- Сброс ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .9em;
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(168, 85, 247, .14);
  color: #d8c8ff;
}

:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- Фон ---------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(130% 90% at 50% 0%,   rgba(0,0,0,0) 0%, rgba(6,5,12,.45) 55%, rgba(6,5,12,.88) 100%),
    radial-gradient(80% 60% at 50% 100%, rgba(6,5,12,.9) 0%, rgba(6,5,12,0) 70%);
}

/* ---------- Утилиты ---------- */
.container {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
}

.muted { color: var(--muted); }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: 12px;
}

/* ---------- Хедер ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(8, 6, 16, .62);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  font-size: 17px;
}

.logo-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  box-shadow: 0 0 14px rgba(168, 85, 247, .9);
}

.logo-text { color: #fff; }
.logo-text span {
  background: linear-gradient(100deg, var(--violet), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-left: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav a {
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 15px;
  color: var(--muted);
  transition: color .25s, background .25s;
}

/* Кнопка-бургер */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 11px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: #fff;
  transition: transform .3s, opacity .3s;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Кнопки ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  user-select: none;
  transition: transform .3s cubic-bezier(.2,.8,.2,1),
              box-shadow .3s, border-color .3s, background .3s;
}

.btn-lg { min-height: 54px; padding: 15px 34px; font-size: 16px; }

.btn-primary {
  color: #fff;
  background: linear-gradient(115deg, var(--violet), var(--indigo) 48%, var(--cyan));
  background-size: 200% 100%;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .14) inset,
    0 12px 38px -14px rgba(168, 85, 247, .95);
  animation: btn-flow 9s ease-in-out infinite;
}

@keyframes btn-flow {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  border-color: var(--line);
  backdrop-filter: blur(8px);
}

.btn:active { transform: translateY(0) scale(.985); }

/* ---------- HERO ---------- */
.hero {
  padding: clamp(72px, 13vw, 140px) 0 clamp(60px, 10vw, 110px);
  text-align: center;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  backdrop-filter: blur(10px);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #cfc8e6;
  margin-bottom: 26px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: .45; transform: scale(.75); }
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(2.7rem, 9.5vw, 5.6rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: .045em;
  background: linear-gradient(100deg,
              #ffffff 0%, #c9b6ff 22%, #7dd3fc 46%,
              #f0abfc 68%, #ffffff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 42px rgba(168, 85, 247, .5));
  animation: title-shimmer 11s linear infinite;
}

@keyframes title-shimmer {
  to { background-position: 220% 0; }
}

.hero-sub {
  margin: 0 0 18px;
  font-size: clamp(1rem, 2.6vw, 1.35rem);
  font-weight: 500;
  color: #b9b2d4;
  letter-spacing: .04em;
}

.hero-desc {
  max-width: 620px;
  margin: 0 0 36px;
  font-size: clamp(.95rem, 2.2vw, 1.08rem);
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-bottom: 28px;
}

.hero-note {
  margin: 0;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(155, 149, 184, .75);
}

/* ---------- Секции ---------- */
.section { padding: clamp(64px, 10vw, 110px) 0; }
.section[id] { scroll-margin-top: calc(var(--header-h) + 24px); }

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(38px, 6vw, 60px);
}

.section-head h2 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: .01em;
}

.section-sub { margin: 0; color: var(--muted); }

/* ---------- Карточки ---------- */
.grid {
  display: grid;
  gap: 20px;
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  position: relative;
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg,
              rgba(255, 255, 255, .055),
              rgba(255, 255, 255, .015));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform .4s cubic-bezier(.2,.8,.2,1),
              border-color .4s, box-shadow .4s;
}

.card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(168,85,247,.6), transparent 45%, rgba(34,211,238,.5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 16px;
  border-radius: 14px;
  font-size: 19px;
  color: #e9dcff;
  background: linear-gradient(140deg, rgba(168,85,247,.35), rgba(34,211,238,.18));
  border: 1px solid rgba(168, 85, 247, .3);
  box-shadow: 0 0 26px -8px rgba(168, 85, 247, .85);
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
}

.card p { margin: 0; font-size: .95rem; }

/* ---------- Шаги ---------- */
.steps {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 760px;
  display: grid;
  gap: 14px;
  counter-reset: step;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: border-color .35s, transform .35s, box-shadow .35s;
}

.step-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(140deg, var(--violet), var(--indigo));
  box-shadow: 0 0 24px -6px rgba(168, 85, 247, .95);
}

.step-body h3 { margin: 0 0 4px; font-size: 1.05rem; }
.step-body p  { margin: 0; font-size: .93rem; }

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 4px 22px;
  transition: border-color .35s, background .35s;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 34px 18px 0;
  font-weight: 600;
  font-size: 1.02rem;
  position: relative;
  user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: "";
  position: absolute;
  right: 4px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--violet);
  border-bottom: 2px solid var(--violet);
  transform: translateY(-70%) rotate(45deg);
  transition: transform .3s;
}

.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }

.faq-item p {
  margin: 0;
  padding: 0 0 20px;
  font-size: .95rem;
}

/* ---------- Автор ---------- */
.author-card {
  display: flex;
  align-items: center;
  gap: 32px;
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg,
              rgba(168, 85, 247, .12),
              rgba(16, 12, 28, .6) 55%,
              rgba(34, 211, 238, .08));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 30px 80px -50px rgba(168, 85, 247, 1);
}

.author-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 28px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .06em;
  color: #fff;
  background: linear-gradient(140deg, var(--violet), var(--indigo) 55%, var(--cyan));
  box-shadow: 0 0 42px -8px rgba(168, 85, 247, .95);
}

.author-body h2 {
  margin: 0 0 2px;
  font-size: 1.9rem;
  font-weight: 800;
}

.author-body > p { margin: 0 0 18px; font-size: .95rem; }

.nick-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  cursor: pointer;
  transition: border-color .3s, background .3s, box-shadow .3s;
}

.nick-text {
  font-family: ui-monospace, Consolas, monospace;
  font-weight: 700;
  letter-spacing: .04em;
}

.copy-hint {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color .3s;
}

.nick-chip.copied .copy-hint { color: var(--cyan); }

/* ---------- Футер ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(6, 5, 12, .7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 42px 0;
  margin-top: 40px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.footer-brand p,
.footer-meta p { margin: 6px 0 0; font-size: 13px; }

/* ---------- Тост ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom));
  transform: translate(-50%, 24px);
  max-width: min(90vw, 460px);
  padding: 13px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(20, 15, 36, .96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #ece9f7;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  transition: opacity .3s, transform .3s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Появление при скролле ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .8s cubic-bezier(.2,.8,.2,1),
              transform .8s cubic-bezier(.2,.8,.2,1);
  will-change: opacity, transform;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* После завершения анимации app.js добавляет .settled —
   это освобождает композитный слой (will-change больше не нужен). */
.reveal.settled {
  will-change: auto;
}

/* ============================================================
   Auth: кнопка в шапке + модалка входа/регистрации
   ============================================================ */

.nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
}

.nav-login-btn {
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .25s, background .25s, box-shadow .25s;
}

.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .04);
  max-width: 300px;
}

.nav-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--violet), var(--cyan));
  flex: 0 0 auto;
}

.nav-user-email {
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 170px;
}

.nav-user button {
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .25s, background .25s;
  flex: 0 0 auto;
}

/* ---------- Модалка ---------- */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-modal.open { display: flex; }

.auth-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(4, 3, 10, .8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: auth-fade .25s ease;
}

.auth-dialog {
  position: relative;
  z-index: 2;
  width: min(440px, 100%);
  padding: 34px 30px 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(24, 18, 42, .98), rgba(12, 9, 22, .98));
  box-shadow:
    0 0 0 1px rgba(168, 85, 247, .12),
    0 40px 100px -30px rgba(0, 0, 0, .95);
  animation: auth-pop .3s cubic-bezier(.2,.8,.2,1);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@keyframes auth-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes auth-pop {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.auth-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 40px; height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: color .25s, border-color .25s, background .25s;
}

.auth-title {
  margin: 0 0 20px;
  font-size: 1.6rem;
  font-weight: 800;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .03);
}

.auth-tab {
  flex: 1;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .25s, color .25s;
}
.auth-tab.active {
  background: linear-gradient(115deg, var(--violet), var(--indigo));
  color: #fff;
  box-shadow: 0 0 24px -10px rgba(168, 85, 247, .95);
}

.auth-form { display: grid; gap: 16px; }

.auth-field {
  display: grid;
  gap: 7px;
}

.auth-field label {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
}

.auth-field input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .035);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  letter-spacing: normal;
  text-transform: none;
  transition: border-color .25s, background .25s, box-shadow .25s;
  -webkit-appearance: none;
  appearance: none;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .055);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, .18);
}

.auth-error {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid rgba(244, 114, 182, .35);
  border-radius: 12px;
  background: rgba(244, 114, 182, .1);
  color: #ffc6e0;
  font-size: 14px;
}

.auth-submit { width: 100%; margin-top: 4px; }
.auth-submit[disabled] { opacity: .65; cursor: progress; }

.auth-hint {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: rgba(155, 149, 184, .8);
  text-align: center;
}

body.auth-open { overflow: hidden; }

/* ============================================================
   Адаптив
   ============================================================ */

@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  .nav {
    position: fixed;
    top: calc(var(--header-h) + 10px);
    left: 14px;
    right: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(12, 9, 22, .97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .95);

    opacity: 0;
    transform: translateY(-10px) scale(.98);
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 70;
  }

  .nav.open {
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }

  .nav a {
    padding: 13px 16px;
    border-radius: 14px;
    font-size: 16px;
  }

  .nav-auth {
    flex-direction: column;
    align-items: stretch;
    margin: 8px 0 0;
    gap: 8px;
  }
  .nav-user {
    max-width: none;
    justify-content: space-between;
    padding: 6px 8px 6px 14px;
  }
  .nav-user-email { max-width: none; }
  .nav-login-btn { width: 100%; padding: 13px 16px; }
}

/* ---------- Мобильная модалка: полноэкранный режим ---------- */
@media (max-width: 640px) {
  .hero-actions { width: 100%; flex-direction: column; }
  .hero-actions .btn { width: 100%; }

  .author-card {
    flex-direction: column;
    text-align: center;
    gap: 22px;
  }

  .author-avatar { width: 82px; height: 82px; border-radius: 24px; font-size: 19px; }

  .footer-inner { flex-direction: column; }

  .step { padding: 20px; gap: 16px; }
  .step-num { width: 36px; height: 36px; }

  /* --- 关键修复：弹窗全屏，避免键盘遮挡与输入异常 --- */
  .auth-modal {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  .auth-backdrop {
    display: none;
  }

  .auth-dialog {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: 0;
    padding: calc(64px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));
    animation: none;
    background: linear-gradient(180deg, #14102a 0%, #0a0814 100%);
  }

  .auth-close {
    top: calc(14px + env(safe-area-inset-top));
    right: 14px;
    width: 44px;
    height: 44px;
  }

  .auth-field input {
    font-size: 16px;
    padding: 14px 16px;
  }
}

@media (max-width: 400px) {
  .container { width: calc(100% - 28px); }
  .card { padding: 24px 20px; }
}

/* ============================================================
   Hover-эффекты
   Собраны в одном месте и включены только на устройствах
   с настоящим курсором — иначе на тачскрине :hover «залипает»
   после каждого тапа и карточка/кнопка остаётся подсвеченной.
   ============================================================ */

@media (hover: hover) and (pointer: fine) {
  .nav a:hover {
    color: #fff;
    background: rgba(168, 85, 247, .14);
  }

  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, .2) inset,
      0 18px 48px -14px rgba(168, 85, 247, 1);
  }

  .btn-ghost:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background: rgba(168, 85, 247, .12);
    box-shadow: 0 14px 36px -18px rgba(168, 85, 247, .9);
  }

  .card:hover {
    transform: translateY(-5px);
    border-color: transparent;
    box-shadow: 0 24px 60px -28px rgba(168, 85, 247, .85);
  }

  .card:hover::after { opacity: 1; }

  .step:hover {
    border-color: var(--line-strong);
    transform: translateX(4px);
    box-shadow: 0 20px 50px -30px rgba(168, 85, 247, .9);
  }

  .faq-item:hover { border-color: var(--line-strong); }

  .nick-chip:hover {
    border-color: var(--line-strong);
    background: rgba(168, 85, 247, .14);
    box-shadow: 0 0 30px -12px rgba(168, 85, 247, .95);
  }

  .nav-login-btn:hover {
    border-color: var(--line-strong);
    background: rgba(168, 85, 247, .14);
    box-shadow: 0 0 26px -12px rgba(168, 85, 247, .95);
  }

  .nav-user button:hover {
    border-color: var(--line-strong);
    background: rgba(168, 85, 247, .16);
  }

  .auth-close:hover {
    color: #fff;
    border-color: var(--line-strong);
    background: rgba(168, 85, 247, .16);
  }
}

/* ---------- Уважение к настройкам системы ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }

  .hero-title,
  .btn-primary,
  .badge-dot { animation: none !important; }

  * { transition-duration: .01ms !important; }
}

/* ============================================================
   Персоналии (dogs / goodguys)
   Карточки: сверху квадратный портрет, снизу имя и описание.
   Портрет по умолчанию — градиентный блок с номером;
   чтобы поставить картинку, достаточно раскомментировать <img>
   внутри .person-portrait — он перекроет блок автоматически.
   ============================================================ */

.person-grid {
  max-width: 980px;
  margin: 0 auto;
}

.person-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg,
              rgba(255, 255, 255, .055),
              rgba(255, 255, 255, .015));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
  transition: transform .4s cubic-bezier(.2,.8,.2,1),
              border-color .4s, box-shadow .4s;
}

.person-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg,
              rgba(168, 85, 247, .6),
              transparent 45%,
              rgba(34, 211, 238, .5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}

/* Квадратный портрет */
.person-portrait {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  font-weight: 900;
  letter-spacing: .06em;
  color: #fff;
  background: linear-gradient(140deg, var(--violet), var(--indigo) 55%, var(--cyan));
  overflow: hidden;
}

/* Как только в .person-portrait появится <img>, он
   полностью перекроет цветной блок с номером. */
.person-portrait img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

/* Тональные варианты — чтобы 6 карточек не выглядели однообразно */
.person-portrait.tone-2 {
  background: linear-gradient(140deg, var(--indigo), var(--violet) 55%, var(--pink));
}
.person-portrait.tone-3 {
  background: linear-gradient(140deg, var(--cyan), var(--indigo) 55%, var(--violet));
}
.person-portrait.tone-4 {
  background: linear-gradient(140deg, var(--pink), var(--indigo) 55%, var(--cyan));
}

.person-body {
  padding: 22px 22px 24px;
}

.person-body h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  font-weight: 700;
}

.person-body p {
  margin: 0;
  font-size: .94rem;
}

@media (hover: hover) and (pointer: fine) {
  .person-card:hover {
    transform: translateY(-5px);
    border-color: transparent;
    box-shadow: 0 24px 60px -28px rgba(168, 85, 247, .85);
  }
  .person-card:hover::after { opacity: 1; }
}
