:root{
  --bg:#0b0f17;
  --panel:#0f1624;
  --card:#0f172a;
  --line:rgba(255,255,255,.10);
  --text:#eaf0ff;
  --muted:rgba(234,240,255,.72);
  --accent:#4ea1ff;
  --accent2:#7c5cff;
  --danger:#ff6b6b;
  --shadow: 0 18px 45px rgba(0,0,0,.45);
  --radius:16px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(78,161,255,.25), transparent 60%),
    radial-gradient(900px 500px at 90% 0%, rgba(124,92,255,.22), transparent 60%),
    var(--bg);
  color:var(--text);
  padding-top: 64px;
}

/* Topbar */
.topbar{
  position:fixed;
  top:0;
  z-index:50;
  backdrop-filter: blur(10px);
  background: rgba(11,15,23,.72);
  border-bottom:1px solid var(--line);
}
.topbar__inner{
  max-width:980px;
  margin:0 auto;
  padding:12px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.logo{
  text-decoration:none;
  color:var(--text);
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
.logo__text{
  font-weight:900;
  letter-spacing:.08em;
  font-size:14px;
  white-space:nowrap;
}

/* nav */
.nav{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.nav a{
  color:var(--muted);
  text-decoration:none;
  font-size:13px;
  padding:8px 10px;
  border:1px solid transparent;
  border-radius:999px;
  transition: .15s ease;
}
.nav a:hover{
  border-color:var(--line);
  color:var(--text);
}
.nav__cta{
  background: linear-gradient(90deg, rgba(78,161,255,.22), rgba(124,92,255,.22));
  border-color:rgba(78,161,255,.35) !important;
  color:var(--text) !important;
}

/* Sections */
.section, .hero{
  max-width:980px;
  margin:0 auto;
  padding:22px 16px;
}
.section__head{
  margin-bottom:12px;
}
.section__head h2{
  margin:0;
  font-size:22px;
  letter-spacing:.01em;
}
.muted{ color:var(--muted); }
.small{ font-size:12px; }

/* Hero */
.hero{ padding-top:26px; }
.hero__card{
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(15,22,36,.92), rgba(15,23,42,.86));
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding:18px;
}
.hero__meta{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.pill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(78,161,255,.35);
  background: rgba(78,161,255,.12);
}
.dot{ color:rgba(255,255,255,.25); }

.hero__title{
  margin:0;
  font-size:30px;
  line-height:1.08;
}
.hero__lead{
  margin:10px 0 14px 0;
  color:var(--muted);
  font-size:15px;
  line-height:1.5;
}

.hero__grid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin:14px 0;
}
.mini{
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  padding:14px;
}
.mini__title{
  font-weight:800;
  margin-bottom:6px;
}
.mini__text{ color:var(--muted); line-height:1.45; }

.hero__actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}
.fineprint{
  margin-top:12px;
  color:rgba(234,240,255,.55);
  font-size:12px;
  line-height:1.45;
}

/* Cards */
.cards{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
.card{
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.04);
  padding:14px;
}
.card h3{
  margin:0 0 8px 0;
  font-size:16px;
}
.card p{ margin:0 0 10px 0; color:var(--muted); line-height:1.5; }
.card p:last-child{ margin-bottom:0; }
.card--compact p{ margin:0; }

/* Promo */
.promo{
  border:1px solid rgba(78,161,255,.28);
  background: linear-gradient(180deg, rgba(78,161,255,.10), rgba(124,92,255,.08));
  border-radius: calc(var(--radius) + 6px);
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.32);
}
.promo__badge{
  display:inline-block;
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(124,92,255,.35);
  background: rgba(124,92,255,.14);
  margin-bottom:10px;
}
.promo__title{
  font-weight:900;
  font-size:20px;
}
.promo__sub{ color:rgba(234,240,255,.65); font-size:12px; margin-top:6px; }
.promo__text{ margin:12px 0 0 0; color:var(--muted); line-height:1.5; }
.promo__right{ display:flex; flex-direction:column; gap:8px; }

/* Check */
.check{
  border:1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background: rgba(255,255,255,.04);
  padding:16px;
  display:grid;
  gap:12px;
  max-width:520px;
}
.field{ display:grid; gap:6px; }
.field__label{ font-size:12px; color:rgba(234,240,255,.7); }
input{
  padding:12px 12px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  color:var(--text);
  outline:none;
}
input:focus{
  border-color: rgba(78,161,255,.55);
  box-shadow: 0 0 0 3px rgba(78,161,255,.18);
}
.error{
  margin:0;
  min-height:18px;
  color: var(--danger);
  font-size:13px;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:11px 14px;
  border-radius: 12px;
  border:1px solid rgba(78,161,255,.45);
  background: linear-gradient(90deg, rgba(78,161,255,.95), rgba(124,92,255,.92));
  color:#07101f;
  font-weight:900;
  text-decoration:none;
  cursor:pointer;
  transition:.15s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn--ghost{
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn--ghost:hover{ border-color: rgba(78,161,255,.35); }
.btn--wide{ width:100%; }

/* Gift */
.section--gift{ padding-bottom:40px; }
.gift{
  border:1px solid rgba(78,161,255,.30);
  background: linear-gradient(180deg, rgba(78,161,255,.12), rgba(124,92,255,.10));
  border-radius: calc(var(--radius) + 10px);
  padding:18px;
  box-shadow: var(--shadow);
}
.gift__icon{ font-size:26px; }
.gift__title{ margin:6px 0 6px 0; font-size:26px; }
.gift__lead{ margin:0 0 12px 0; color:var(--muted); line-height:1.5; }
.gift__card{
  border:1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0,0,0,.18);
  padding:14px;
}
.gift__row{ padding:8px 0; border-bottom:1px solid rgba(255,255,255,.06); color:rgba(234,240,255,.9); }
.gift__row:last-child{ border-bottom:none; }
.gift__fine{ margin-top:10px; }
.gift__sign{ margin-top:12px; }
.gift__actions{ margin-top:14px; }

.hidden{ display:none; }

/* Footer */
.footer{
  border-top:1px solid var(--line);
  margin-top:10px;
}
.footer__inner{
  max-width:980px;
  margin:0 auto;
  padding:16px;
}

/* Desktop tweaks */
@media (min-width: 780px){
  .hero__title{ font-size:40px; }
  .hero__grid{ grid-template-columns:1fr 1fr; }
  .cards{ grid-template-columns:1fr 1fr; }
  .promo{ flex-direction:row; align-items:flex-start; justify-content:space-between; }
  .promo__left{ max-width:650px; }
  .promo__right{ min-width:240px; }
}
/* --- Mobile Safari / overflow fix --- */
html, body { 
  width: 100%;
  overflow-x: hidden; 
}

.page, .section, .hero { 
  width: 100%;
  overflow-x: hidden;
}

/* чтобы элементы не раздували ширину экрана */
img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

/* iOS Safari иногда косячит с 100vw, фиксируем */
.topbar { 
  width: 100%;
}
/* ===== Header nav: clip + scroll (best practice) ===== */

/* Desktop: как было — меню справа, без скролла */
.navwrap{ display:block; }
.nav{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

/* ===== iOS-safe header: logo fixed, nav clipped & scrollable ===== */

@media (max-width: 640px){

  /* если где-то появился горизонтальный оверфлоу — гасим */
  html, body { overflow-x: hidden; }

  .topbar { overflow: hidden; }

  .topbar__inner{
    display:flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  /* Левая зона: резерв под название */
  .brand{
    flex: 0 0 auto;
    max-width: 62%;
    min-width: 0;
    overflow: hidden;
  }

  .logo{
    display:block;
    text-decoration:none;
    color: var(--text);
  }

  .logo__text{
    display:block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 18px;
    letter-spacing: .08em;
  }

  /* Правая зона: окно, которое обрезает "уехавшее" меню */
  .navwrap{
    flex: 1 1 0;
    min-width: 0;              /* КРИТИЧНО для iOS */
    overflow: hidden;          /* обрезаем всё, что уезжает */
  }

  /* Само меню скроллится ВНУТРИ окна */
  .nav{
    display:flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar{ display:none; }

  .nav a{ flex: 0 0 auto; }
}

/* iOS: не зумить при фокусе на input (нужно >=16px) */
input, textarea, select {
  font-size: 16px;
}

/* На всякий случай: не меняй авто-размер текста на iOS */
html {
  -webkit-text-size-adjust: 100%;
}