/* Палитра и базовые переменные */
:root {
  --header-h: 64px;        /* высота шапки для якорей */
  --bg: #0b132b;           /* тёмно-синий почти чёрный */
  --bg-elev: #1c2541;      /* тёмно-синий */
  --bg-plate: #232c4b;     /* плитка/карточки */
  --text: #e5e7eb;         /* светло-серый текст */
  --muted: #9aa4b2;        /* приглушённый текст */
  --accent: #f59e0b;       /* оранжевый акцент */
  --accent-2: #fbbf24;     /* светлее для hover */
  --border: #2b355a;       /* линия/границы */
  --ok: #22c55e;           /* успех формы */
  --error: #ef4444;        /* ошибка формы */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Inter, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container {
  width: min(1200px, 92%);
  margin-inline: auto;
}

.section { padding: 72px 0; scroll-margin-top: calc(var(--header-h) + 10px); }
.section h2 {
  font-size: clamp(24px, 2.8vw, 36px);
  margin: 0 0 24px;
}

/* Шапка */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(11, 19, 43, 0.8);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.logo-mark {
  width: 22px; height: 22px; border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 2px #111624 inset, 0 2px 12px rgba(245, 158, 11, 0.2);
}
.logo-text { font-size: 16px; letter-spacing: 0.3px; }

.nav { display: none; gap: 18px; align-items: center; }
.nav a { opacity: 0.9; }
.nav a:hover { opacity: 1; }
.nav-cta { margin-left: 6px; }

.nav-toggle { display: inline-flex; flex-direction: column; gap: 4px; background: none; border: none; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); display: block; }

@media (min-width: 900px) {
  .nav { display: flex; }
  .nav-toggle { display: none; }
}

/* Герой */
.hero { position: relative; overflow: hidden; padding: 96px 0 120px; }
.hero-inner { position: relative; z-index: 1; }
.hero-title {
  font-size: clamp(32px, 7vw, 64px);
  margin: 0 0 12px;
  letter-spacing: 0.5px;
}
.hero-subtitle { font-size: clamp(16px, 2.5vw, 22px); color: var(--muted); margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; align-items: center; }
.hero-bg::before, .hero-bg::after {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 75%; z-index: 0;
  background: radial-gradient(60% 70% at 20% 30%, rgba(245,158,11,0.12), transparent 60%),
              radial-gradient(50% 50% at 90% 10%, rgba(59,130,246,0.08), transparent 60%),
              linear-gradient(180deg, rgba(28,37,65,0.8), transparent);
  mask-image: linear-gradient(to bottom, black, black 60%, transparent 100%);
}
.hero-bg::after {
  inset: auto -20% -30% -20%; height: 55%;
  background: radial-gradient(60% 70% at 80% 60%, rgba(59,130,246,0.08), transparent 60%),
              radial-gradient(50% 50% at 10% 90%, rgba(245,158,11,0.10), transparent 60%);
}

/* Текстовый блок */
.text-block { background: linear-gradient(180deg, rgba(35,44,75,0.6), rgba(35,44,75,0.3)); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
.text-block p { margin: 0; color: var(--text); opacity: 0.95; }

/* Карточки услуг */
.cards { display: grid; grid-template-columns: repeat(1, minmax(0, 1fr)); gap: 16px; }
.card {
  background: linear-gradient(180deg, rgba(35,44,75,0.7), rgba(35,44,75,0.35));
  border: 1px solid var(--border); border-radius: 12px; padding: 20px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,0.25); border-color: #33406c; }
.card .icon { width: 40px; height: 40px; color: var(--accent); margin-bottom: 12px; }
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }

@media (min-width: 700px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards { grid-template-columns: repeat(4, 1fr); } }

/* Галерея */
.projects .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.gallery {
  margin-top: 16px;
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 800px) { .gallery { grid-template-columns: repeat(3, 1fr); } }

/* Ровная сетка изображений: одинаковое соотношение сторон */
.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3; /* при желании можно сменить на 16 / 9 */
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #0f1736; /* фон-заглушка до загрузки */
}

/* Стили плейсхолдеров (на случай, если они ещё где-то остались) */
.ph {
  background: repeating-linear-gradient(45deg, #1b2444, #1b2444 10px, #1f2950 10px, #1f2950 20px);
  border: 1px dashed #3a4674; color: #b8c1d9;
  border-radius: 12px; min-height: 140px; display: grid; place-items: center; font-size: 14px;
}

/* Преимущества */
.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(1, 1fr); gap: 12px; }
.features li {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: linear-gradient(180deg, rgba(35,44,75,0.55), rgba(35,44,75,0.28));
  border: 1px solid var(--border); border-radius: 12px;
}
.badge {
  width: 28px; height: 28px; border-radius: 8px; display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0b132b; font-weight: 700;
}
@media (min-width: 900px) { .features { grid-template-columns: repeat(2, 1fr); } }

/* Контакты */
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.contact .phone a { font-size: 20px; color: var(--text); }
.messengers { display: flex; gap: 10px; margin: 10px 0 0; }
.contact-form { background: linear-gradient(180deg, rgba(35,44,75,0.6), rgba(35,44,75,0.3)); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.form-row { display: grid; gap: 6px; margin-bottom: 12px; }
label { font-size: 14px; color: var(--muted); }
input, textarea { border: 1px solid #2f3a62; background: #0f1736; color: var(--text); border-radius: 10px; padding: 10px 12px; font-size: 14px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(245,158,11,0.12); }
.error { color: var(--error); font-size: 12px; min-height: 16px; }
.form-note { margin: 8px 0 0; }
.form-success { color: var(--ok); margin-top: 10px; }

@media (min-width: 900px) { .contact-grid { grid-template-columns: 1.1fr 1fr; } }

/* Футер */
.site-footer { border-top: 1px solid var(--border); padding: 20px 0; background: #0a1026; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 14px 18px; font-size: 16px; }
.btn-full { width: 100%; }
.btn-accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0b132b; box-shadow: 0 6px 18px rgba(245,158,11,0.25); }
.btn-accent:hover { box-shadow: 0 8px 24px rgba(245,158,11,0.35); }
.btn-outline { border-color: #3a4674; color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--accent); color: var(--text); box-shadow: 0 0 0 4px rgba(245,158,11,0.12) inset; }

/* Мобильное меню (простая реализация) */
.mobile-open .nav { display: grid; position: absolute; right: 4%; top: var(--header-h); background: #0f1736; border: 1px solid var(--border); border-radius: 12px; padding: 10px; gap: 8px; }

/* Аккуратная прокрутка к якорям */
html { scroll-behavior: smooth; }

/* Skip-link для быстрого перехода к контенту */
.skip-link {
  position: absolute; left: 8px; top: -40px; z-index: 1001;
  background: #111624; color: var(--text); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
.skip-link:focus { top: 8px; outline: none; box-shadow: 0 0 0 4px rgba(245,158,11,0.18); }

/* Улучшенные фокусные состояния */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:focus-visible, .nav a:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(245,158,11,0.2); }

/* Предпочтение уменьшенной анимации */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

