:root {
  --fg: #ffffff;
  --dim: rgba(255, 255, 255, .74);
  --sun-1: #ffd873;
  --sun-2: #ff9f52;
  --sky: #63b3ff;
  --radius: 20px;
  --shadow-text: 0 1px 14px rgba(8, 26, 60, .55);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  background: #0b1a30;
  color: var(--fg);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-shadow: var(--shadow-text);
}

/* фон: картинка стоит на месте, крутится только содержимое */
.bg {
  position: fixed;
  inset: -40px;
  z-index: -2;
  background: url("bg.webp") center / cover no-repeat;
  transform: scale(1.04); /* запас, чтобы блюр не показывал края */
}

body:not(.home) .bg { filter: blur(3px); }

.bg-dim {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .58;
  background:
    radial-gradient(1100px 620px at 62% 12%, rgba(255, 214, 130, .20), transparent 65%),
    linear-gradient(180deg, rgba(6, 18, 38, .45) 0%, rgba(5, 14, 32, .82) 100%);
  transition: opacity .12s linear;
}

body.home .bg-dim { opacity: 0; }

a { color: inherit; text-decoration: none; }

/* ---------- liquid glass ---------- */
.glass {
  position: relative;
  background: linear-gradient(155deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, .09));
  border: 1px solid rgba(255, 255, 255, .42);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  box-shadow:
    0 12px 34px rgba(6, 22, 52, .28),
    inset 0 1px 0 rgba(255, 255, 255, .7),
    inset 0 -10px 22px rgba(255, 255, 255, .12);
  overflow: hidden;
}

.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(108deg, rgba(255, 255, 255, .38) 0%, rgba(255, 255, 255, .06) 32%, rgba(255, 255, 255, 0) 55%);
}

.glass:hover {
  background: linear-gradient(155deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .14));
  border-color: rgba(255, 255, 255, .6);
}

/* ---------- nav ---------- */
.nav-wrap {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 18px 16px;
}

.nav {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 9px 9px 16px;
  border-radius: 999px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -.01em;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: block;
}

.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.nav-link,
.nav-btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 550;
  position: relative;
  z-index: 1;
}

.nav-btn { min-width: 96px; text-align: center; }

main { flex: 1; }

/* ---------- hero ---------- */
.hero {
  min-height: calc(100vh - 150px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px 100px;
  position: relative;
}

.hero-logo {
  width: 86px;
  height: 86px;
  margin-bottom: 26px;
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(6, 20, 50, .5);
}

.hero h1 {
  margin: 0;
  max-width: 940px;
  font-size: clamp(34px, 6vw, 66px);
  line-height: 1.07;
  font-weight: 750;
  letter-spacing: -.03em;
  text-shadow: 0 2px 24px rgba(6, 22, 55, .6);
}

.hero-sub {
  max-width: 570px;
  margin: 22px 0 0;
  font-size: 17px;
  color: rgba(255, 255, 255, .92);
}

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

.scroll-hint {
  position: absolute;
  bottom: 40px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  animation: float 2.2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(8px); }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: var(--fg);
}

.btn-primary {
  background: linear-gradient(140deg, var(--sun-1), var(--sun-2));
  border-color: rgba(255, 255, 255, .6);
  color: #2a1400;
  text-shadow: none;
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(140deg, #ffe08d, #ffae6a);
  border-color: rgba(255, 255, 255, .8);
}

.btn-block { width: 100%; margin-top: 8px; }

/* ---------- sections ---------- */
.section {
  max-width: 1020px;
  margin: 0 auto;
  padding: 80px 20px 110px;
}

.pill {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
}

.section h2 {
  margin: 20px 0 0;
  font-size: clamp(28px, 4.4vw, 46px);
  letter-spacing: -.025em;
  font-weight: 750;
}

.section-sub {
  margin: 12px 0 0;
  color: var(--dim);
  max-width: 520px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 42px;
}

.card {
  grid-column: span 2;
  padding: 28px;
  border-radius: var(--radius);
  transition: transform .2s ease;
}

.card-wide { grid-column: span 3; }

.card:hover { transform: translateY(-4px); }

.card h3 {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 650;
}

.ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(140deg, rgba(255, 216, 115, .9), rgba(255, 159, 82, .85));
  color: #2a1400;
  font-size: 16px;
  text-shadow: none;
}

.card p { margin: 0; color: var(--dim); }

.card h3, .card p { position: relative; z-index: 1; }

/* ---------- auth ---------- */
.auth {
  display: grid;
  place-items: center;
  padding: 40px 20px 90px;
  min-height: 68vh;
}

.panel {
  width: 100%;
  max-width: 430px;
  padding: 34px;
  border-radius: 24px;
}

.panel > * { position: relative; z-index: 1; }

.eyebrow {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
}

.panel h2 { margin: 8px 0 26px; font-size: 28px; letter-spacing: -.02em; }

form label { display: block; margin-bottom: 16px; }

form label > span {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  color: var(--dim);
}

form small {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  color: rgba(255, 255, 255, .6);
}

input {
  width: 100%;
  padding: 12px 15px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px);
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  text-shadow: none;
}

input::placeholder { color: rgba(255, 255, 255, .55); }

input:focus {
  outline: none;
  border-color: #fff;
  background: rgba(255, 255, 255, .24);
}

.alt {
  margin: 22px 0 0;
  font-size: 14px;
  color: var(--dim);
  text-align: center;
}

.alt a { text-decoration: underline; text-underline-offset: 3px; }

.flash-stack {
  max-width: 460px;
  margin: 6px auto -20px;
  padding: 0 20px;
}

.flash {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 14px;
  margin-bottom: 8px;
}

/* ---------- profile ---------- */
.profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-head h2 { margin-top: 14px; }

.user-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  border-radius: var(--radius);
  margin-top: 30px;
}

.avatar {
  display: block;
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 6px 18px rgba(6, 20, 50, .35);
  position: relative;
  z-index: 1;
}

.user-name { font-size: 23px; font-weight: 700; letter-spacing: -.02em; }

.dim { color: var(--dim); font-size: 14px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(195px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.stat {
  padding: 22px;
  border-radius: var(--radius);
}

.stat-label {
  font-size: 13px;
  color: var(--dim);
  margin-bottom: 6px;
  position: relative;
  z-index: 1;
}

.stat-value { font-size: 18px; font-weight: 650; position: relative; z-index: 1; }

.actions-title {
  margin: 54px 0 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.action {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-radius: var(--radius);
  transition: transform .18s ease;
}

.action > * { position: relative; z-index: 1; }

.action:hover { transform: translateY(-3px); }

.action-name { display: block; font-weight: 650; font-size: 16px; }

.action .dim { display: block; }

.action .arrow {
  margin-left: auto;
  font-size: 18px;
  color: var(--dim);
}

/* ---------- footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1020px;
  width: 100%;
  margin: 0 auto;
  padding: 26px 20px 34px;
  border-top: 1px solid rgba(255, 255, 255, .18);
  font-size: 14px;
  color: var(--dim);
}

/* ловушка для ботов, человек её не видит */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cf-note {
  display: block;
  margin: -8px 0 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, .6);
  position: relative;
  z-index: 1;
}

.cf-turnstile {
  margin: 2px 0 8px;
  min-height: 65px;
  position: relative;
  z-index: 1;
}

/* ---------- телефоны и планшеты ---------- */
@media (max-width: 900px) {
  .section { max-width: 100%; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card, .card-wide { grid-column: span 1; }
}

@media (max-width: 760px) {
  .nav-wrap { padding: 12px 12px; }
  .nav { padding: 8px 8px 8px 12px; gap: 8px; }
  .brand span { display: none; }
  .nav-center { position: static; transform: none; margin: 0 auto; }
  .nav-link, .nav-btn { padding: 8px 15px; font-size: 13px; }
  .nav-btn { min-width: 0; }

  .hero { min-height: calc(100svh - 120px); padding: 20px 18px 90px; }
  .hero-logo { width: 68px; height: 68px; border-radius: 20px; margin-bottom: 20px; }
  .hero-sub { font-size: 16px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1 1 100%; text-align: center; }
  .scroll-hint { bottom: 26px; }

  .section { padding: 56px 18px 80px; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 22px; }

  .auth { padding: 24px 16px 70px; min-height: 0; }
  .panel { padding: 24px 20px; border-radius: 20px; }
  .panel h2 { font-size: 24px; margin-bottom: 20px; }
  /* 16px, иначе Safari на айфоне зумит страницу при фокусе */
  input { font-size: 16px; }

  .profile-head { align-items: flex-start; }
  .user-card { padding: 20px; gap: 14px; }
  .avatar { width: 50px; height: 50px; border-radius: 15px; }
  .user-name { font-size: 20px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 16px; }
  .actions { grid-template-columns: 1fr; }
  .actions-title { margin-top: 40px; font-size: 21px; }

  .footer { padding: 22px 18px 30px; font-size: 13px; }

  /* блюр на телефоне дороже, поэтому мягче */
  .glass { backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%); }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .action { padding: 16px 18px; gap: 12px; }
}
