/* ════════════════════════════════════════════
   RESET & BASE
════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Manrope', sans-serif;
  color: #ffffff;
  overflow-x: hidden;
  overflow-y: scroll;
  height: 100%;
  -webkit-font-smoothing: antialiased;

  /* bg.jpg на весь сайт, сетка поверх */
  background-color: #050d1a;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M 60 0 L 0 0 0 60' fill='none' stroke='rgba(59,130,246,0.18)' stroke-width='0.6'/%3E%3C/svg%3E"),
    url("bg.jpg");
  background-size: auto, cover;
  background-position: center top, center top;
  background-attachment: fixed, fixed;
  background-blend-mode: normal, luminosity;
}

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

/* ════════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bounceDown {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(10px); }
}

.fade-in-1 { animation: fadeInUp 0.6s 0.0s  ease both; }
.fade-in-2 { animation: fadeInUp 0.6s 0.15s ease both; }
.fade-in-3 { animation: fadeInUp 0.6s 0.3s  ease both; }
.fade-in-4 { animation: fadeInUp 0.6s 0.45s ease both; }
.fade-in-5 { animation: fadeInUp 0.6s 0.6s  ease both; }
.fade-in-6 { animation: fadeInUp 0.6s 0.75s ease both; }

/* ════════════════════════════════════════════
   ICONS
════════════════════════════════════════════ */
.icon-sm     { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }
.icon-xs     { width: 14px; height: 14px; stroke-width: 2; flex-shrink: 0; }
.icon-social { width: 30px; height: 30px; flex-shrink: 0; }

/* lucide рендерит <i> → <svg>, фиксируем размеры чтобы не ломался layout */
.icon-sm svg, i.icon-sm   { width: 16px; height: 16px; flex-shrink: 0; }
.icon-xs svg, i.icon-xs   { width: 14px; height: 14px; flex-shrink: 0; }
.icon-social svg, i.icon-social { width: 20px; height: 20px; flex-shrink: 0; }
.muted { color: rgba(255,255,255,0.25); }

/* ════════════════════════════════════════════
   UTILITY
════════════════════════════════════════════ */
.gradient-text {
  background: linear-gradient(135deg, #60a5fa, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ════════════════════════════════════════════
   SECTION COMMON
════════════════════════════════════════════ */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 16px;
}
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #60a5fa;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 14px;
}
.section-subtitle {
  color: rgba(255,255,255,0.5);
  font-size: 1rem;
  line-height: 1.75;
}
.divider {
  width: 52px;
  height: 3px;
  background: linear-gradient(90deg, #3b82f6, #6d28d9);
  border-radius: 2px;
  margin: 28px auto 44px;
}

/* Стрелка-скролл (общая) */
.scroll-arrow {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.28);
  animation: bounceDown 1.8s ease-in-out infinite;
  z-index: 1;
  display: flex;
}
.scroll-arrow i, .scroll-arrow svg { width: 30px; height: 30px; }
.scroll-arrow:hover { color: rgba(255,255,255,0.55); }

/* ════════════════════════════════════════════
   HERO
════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 100px;
  overflow: clip; /* clip не обрезает абсолютно позиционированных потомков */
  background: transparent; /* фон теперь на body */
}

/* тёмный оверлей чтобы текст читался */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(5, 13, 26, 0.86);
  z-index: 0;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.orb-blue   { width: 520px; height: 420px; background: rgba(59,130,246,0.13); top: -80px; right: 5%; }
.orb-violet { width: 420px; height: 360px; background: rgba(109,40,217,0.11); bottom: 5%; left: -60px; }

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 70px;
}

.hero-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

/* Аватар */
.avatar-ring {
  width: 175px; height: 175px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, #3b82f6, #6d28d9);
  flex-shrink: 0;
}
.avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #0d1f3c;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-inner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-placeholder {
  display: none;
  align-items: center; justify-content: center;
  width: 100%; height: 100%;
  font-size: 1.8rem; font-weight: 700; color: #60a5fa;
  background: rgba(59,130,246,0.1);
}

/* Имя — одна строка, весь градиент */
.hero-name-block { display: flex; flex-direction: column; gap: 8px; }
.hero-name {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  /* весь текст — градиент */
  background: linear-gradient(160deg, #ffffff 30%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-role {
  display: inline-block;
  padding: 5px 16px;
  border: 1px solid rgba(96,165,250,0.35);
  border-radius: 20px;
  background: rgba(59,130,246,0.08);
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  width: fit-content;
}

.hero-description {
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.6);
  max-width: 440px;
}

.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 16px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.5);
  font-size: 0.88rem;
}

/* Соцсети */
.hero-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  flex-shrink: 0;
}
.social-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 28px;
  width: 265px;
  background: rgba(13, 31, 60, 0.92);
  border: 1px solid rgba(96,165,250,0.25);
  border-radius: 12px;
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.22s, border-color 0.22s, box-shadow 0.22s;
}
.social-btn svg, .social-btn i { color: #60a5fa; }
.social-btn:hover {
  background: rgba(59,130,246,0.25);
  border-color: rgba(59,130,246,0.6);
  box-shadow: 0 0 22px rgba(59,130,246,0.25);
}

/* ════════════════════════════════════════════
   ФОРМА ЗАЯВКИ
════════════════════════════════════════════ */
.calendar-section {
  position: relative;
  min-height: 100vh;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 24px;
  background: rgba(5, 13, 26, 0.86);
}

.contact-form {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

/* Все поля — в один столбец */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-input {
  background: rgba(13, 31, 60, 0.92);
  border: 1px solid rgba(91, 92, 109, 0.534);
  border-radius: 12px;
  padding: 16px 20px;
  color: rgba(255,255,255,0.2);
  -webkit-text-fill-color: rgba(255,255,255,0.2);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s, background 0.2s, color 0.2s, -webkit-text-fill-color 0.2s;
  outline: none;
  width: 100%;
  caret-color: #60a5fa;
}
/* Заполненное поле — полностью белый текст */
.form-input:not(:placeholder-shown) {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}
/* Фокус — полностью белый текст */
.form-input:focus {
  border-color: rgba(59,130,246,0.6);
  background: rgba(13, 31, 60, 0.98);
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}
/* Select — отдельно, т.к. :placeholder-shown не работает на select */
.form-select {
  color: rgba(255,255,255,0.2);
  -webkit-text-fill-color: rgba(255,255,255,0.2);
}
.form-select:focus,
.form-select.is-filled {
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}
/* Автозаполнение браузера — фон не должен перебивать */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(13, 31, 60, 0.98) inset;
  -webkit-text-fill-color: #ffffff !important;
  caret-color: #60a5fa;
}
.form-input::placeholder { color: rgba(255,255,255,0.2); }

.form-textarea { resize: vertical; min-height: 120px; }

/* Select времени */
.select-wrap { position: relative; }
.form-select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 48px;
}
.form-select option { background: #0d1f3c; color: #fff; }
.form-select option:disabled { color: rgba(255,255,255,0.3); }
.select-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px; height: 18px;
  color: rgba(255,255,255,0.35);
  pointer-events: none;
}

/* Кнопка отправки */
.form-footer {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.form-submit {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.form-notice {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.28);
  margin: 0;
}

/* Toast */
@keyframes toastIn  { from { opacity: 0; transform: translateX(-50%) translateY(16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(-50%) translateY(0); } to { opacity: 0; transform: translateX(-50%) translateY(16px); } }

.toast {
  display: none; /* hidden by default — JS добавляет .toast--show */
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-radius: 14px;
  background: rgba(13, 31, 60, 0.95);
  border: 1px solid rgba(96,165,250,0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  font-size: 0.95rem;
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  pointer-events: none;
}
.toast--show { display: flex; animation: toastIn  0.35s ease both; }
.toast--hide { display: flex; animation: toastOut 0.4s  ease both; }
#toastIcon   { font-size: 1.3rem; }

/* Fallback */
.calendar-fallback {
  margin-top: 28px;
  color: rgba(255,255,255,0.32);
  font-size: 0.88rem;
  text-align: center;
}
.calendar-fallback a { color: #60a5fa; transition: color 0.2s; }
.calendar-fallback a:hover { color: #93c5fd; }

/* CTA кнопка */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #6d28d9);
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, box-shadow 0.2s;
  border: none;
}
.cta-btn:hover {
  opacity: 0.88;
  box-shadow: 0 0 28px rgba(59,130,246,0.35);
}

/* ════════════════════════════════════════════
   ПОРТФОЛИО
════════════════════════════════════════════ */
.portfolio-section {
  position: relative;
  min-height: 100vh;
  padding: 100px 24px 120px;

  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(5, 13, 26, 0.86);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 980px;
}

.portfolio-card {
  background: rgba(13, 31, 60, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.portfolio-card:hover {
  transform: scale(1.025);
  border-color: rgba(59,130,246,0.38);
  box-shadow: 0 8px 36px rgba(59,130,246,0.14);
}
.card-cover {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.card-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cpath d='M 30 0 L 0 0 0 30' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='0.5'/%3E%3C/svg%3E");
}
.card-emoji { font-size: 2.8rem; position: relative; z-index: 1; }

.card-body { padding: 18px 18px 16px; }
.card-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.card-title { font-size: 1rem; font-weight: 600; color: #fff; line-height: 1.35; }
.card-desc  { font-size: 0.85rem; color: rgba(255,255,255,0.48); line-height: 1.65; margin-bottom: 14px; }
.card-tags  { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.2);
  color: #93c5fd;
}

.portfolio-cta { margin-top: 52px; text-align: center; }
.cta-hint { color: rgba(255,255,255,0.38); font-size: 0.9rem; margin-bottom: 16px; }

/* ════════════════════════════════════════════
   SUBPAGE (блог, статья)
════════════════════════════════════════════ */
body.subpage {
  scroll-snap-type: none;
  min-height: 100vh;
  /* тот же тёмный оверлей что на секциях главной */
  background-color: #050d1a;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M 60 0 L 0 0 0 60' fill='none' stroke='rgba(59,130,246,0.18)' stroke-width='0.6'/%3E%3C/svg%3E"),
    url("/bg.jpg");
  background-size: auto, cover;
  background-position: center top, center top;
  background-attachment: fixed, fixed;
  background-blend-mode: normal, luminosity;
}

/* оверлей поверх фона */
body.subpage::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(5, 13, 26, 0.86);
  z-index: 0;
  pointer-events: none;
}

body.subpage .subpage-inner {
  position: relative;
  z-index: 1;
}

.subpage-inner {
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.4);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 48px;
  transition: color 0.2s;
}
.back-link:hover { color: #60a5fa; }
.back-link i { width: 16px; height: 16px; }

/* ── Список статей ── */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blog-card {
  display: block;
  padding: 28px 28px 24px;
  background: rgba(13, 31, 60, 0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  transition: border-color 0.22s, box-shadow 0.22s, transform 0.22s;
  cursor: pointer;
}
.blog-card:hover {
  border-color: rgba(59,130,246,0.4);
  box-shadow: 0 8px 32px rgba(59,130,246,0.12);
  transform: translateY(-2px);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.blog-date {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
}
.blog-tags { display: flex; gap: 6px; flex-wrap: wrap; }

.blog-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
  margin-bottom: 8px;
}
.blog-card-desc {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.7;
  margin-bottom: 16px;
}
.blog-read-more {
  font-size: 0.82rem;
  font-weight: 700;
  color: #60a5fa;
  letter-spacing: 0.03em;
}
.blog-empty {
  color: rgba(255,255,255,0.3);
  font-size: 1rem;
  text-align: center;
  padding: 60px 0;
}

/* ── Stagger карточек блога ── */
.blog-list .blog-card {
  opacity: 0;
  animation: fadeInUp 0.55s ease both;
}
.blog-list .blog-card:nth-child(1) { animation-delay: 0.35s; }
.blog-list .blog-card:nth-child(2) { animation-delay: 0.50s; }
.blog-list .blog-card:nth-child(3) { animation-delay: 0.65s; }
.blog-list .blog-card:nth-child(4) { animation-delay: 0.80s; }
.blog-list .blog-card:nth-child(5) { animation-delay: 0.95s; }
.blog-list .blog-card:nth-child(n+6) { animation-delay: 1.10s; }

/* ── Статья ── */
.article-wrap { max-width: 720px; }

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.article-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.article-lead {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.75;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Типографика тела статьи */
.article-body { color: rgba(255,255,255,0.82); line-height: 1.85; font-size: 1rem; }
.article-body h1 { font-size: 1.6rem; font-weight: 800; color: #fff; margin: 48px 0 16px; }
.article-body h2 { font-size: 1.3rem; font-weight: 700; color: #fff; margin: 40px 0 14px; }
.article-body h3 { font-size: 1.1rem; font-weight: 700; color: #fff; margin: 32px 0 12px; }
.article-body p  { margin-bottom: 20px; }
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 20px; }
.article-body li { margin-bottom: 8px; }
.article-body strong { color: #fff; font-weight: 700; }
.article-body em { color: rgba(255,255,255,0.7); font-style: italic; }
.article-body a  { color: #60a5fa; text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: #93c5fd; }
.article-body hr { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 40px 0; }
.article-body blockquote {
  border-left: 3px solid #3b82f6;
  padding: 12px 20px;
  margin: 24px 0;
  background: rgba(59,130,246,0.07);
  border-radius: 0 8px 8px 0;
  color: rgba(255,255,255,0.6);
  font-style: italic;
}
.article-body code {
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 5px;
  padding: 2px 7px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.88em;
  color: #93c5fd;
}
.article-body pre {
  background: rgba(5, 13, 26, 0.9);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 20px 24px;
  overflow-x: auto;
  margin: 24px 0;
}
.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.92rem;
}
.article-body th {
  text-align: left;
  padding: 10px 14px;
  background: rgba(59,130,246,0.1);
  border-bottom: 1px solid rgba(59,130,246,0.25);
  color: #93c5fd;
  font-weight: 700;
}
.article-body td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75);
}
.article-body tr:last-child td { border-bottom: none; }

/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */
@media (max-width: 760px) {
  /* На мобиле snap отключаем — контент длиннее экрана */
  body { scroll-snap-type: none; }
  .hero-inner { flex-direction: column; align-items: center; gap: 32px; text-align: center; }
  .hero-left  { align-items: center; }
  .hero-description { text-align: center; }
  .hero-right { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .social-btn { width: auto; }
  .hero-name  { font-size: 2.2rem; }
  .portfolio-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .portfolio-grid { grid-template-columns: 1fr; }
  .section-title  { font-size: 1.7rem; }
  .hero-name      { font-size: 1.9rem; }
}
