/* ========================================
   RESET & BASE — Mobile First
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent: #8B5CF6;
  --accent-dark: #7C3AED;
  --bg: #18181B;
  --bg-card: #1E1E23;
  --bg-alt: #141417;
  --text: #F4F4F5;
  --text-muted: #71717A;
  --border: rgba(255,255,255,0.07);
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(139,92,246,0.2);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --navbar-h: 64px;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ========================================
   CONTAINER
   ======================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========================================
   NAVBAR
   ======================================== */
.navbar {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  width: auto;
  z-index: 1000;
  height: 56px;
  border-radius: 16px;
  background: rgba(24,24,27,0.85);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  animation: navbarDrop 0.5s cubic-bezier(0.4,0,0.2,1) both;
}

@keyframes navbarDrop {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.navbar.scrolled {
  background: rgba(24,24,27,0.97);
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.navbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.navbar__brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

/* Десктоп-навигация — скрыта на мобилке */
.navbar__links--desktop {
  display: none;
}

/* ── Бургер ── */
.navbar__burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1200;
}

.burger-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1),
              opacity   0.25s ease,
              width     0.25s ease;
  transform-origin: center;
}

.navbar__burger.active .burger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.navbar__burger.active .burger-bar:nth-child(2) {
  opacity: 0;
  width: 0;
}
.navbar__burger.active .burger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   MOBILE MENU — карточка за шапкой (как на скрине)
   ======================================== */
.mobile-menu {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 999;
  border-radius: 16px;
  overflow: hidden;
}

.mobile-menu.open {
  display: flex;
}

.mobile-menu__card {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: rgba(24,24,27,0.98);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  opacity: 0;
  transform: scale(0.97) translateY(-8px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.4,0,0.2,1);
}

.mobile-menu.open .mobile-menu__card {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.mobile-menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  height: 60px;
  flex-shrink: 0;
}

.mobile-menu__close {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  cursor: pointer;
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.mobile-menu__close:hover { background: rgba(255,255,255,0.15); }

.mobile-menu__links {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 20px;
}

.mobile-nav-link {
  font-size: 20px;
  font-weight: 500;
  color: var(--text);
  padding: 13px 24px;
  border-radius: 12px;
  text-align: center;
  width: 100%;
  transition: background 0.2s, color 0.2s;
}
.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: rgba(124,58,237,0.08);
  color: var(--accent);
}

.mobile-menu__cta {
  padding: 16px 20px 20px;
  flex-shrink: 0;
}

/* Desktop nav */
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover {
  color: var(--accent);
  background: rgba(124,58,237,0.08);
}

.nav-cta { margin-left: 8px; }

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-dark);
  box-shadow: 0 4px 20px rgba(124,58,237,0.35);
}

.btn--outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid rgba(255,255,255,0.15);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--lg {
  padding: 14px 28px;
  font-size: 15px;
}

.btn--sm {
  padding: 7px 16px;
  font-size: 13px;
}

/* ========================================
   HERO
   ======================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: calc(56px + 24px + 32px) 0 80px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 30% 40%, rgba(124,58,237,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 80% 60%, rgba(124,58,237,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.hero__layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.hero__content {
  flex: 1;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.hero__content.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Gear canvas (fixed, full viewport) ── */
#gearCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  contain: layout style paint;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ── Hero visual / gear positioning target ── */
.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero__gear-space {
  width: 280px;
  height: 280px;
}

@media (min-width: 768px) {
  .hero__gear-space {
    width: 360px;
    height: 360px;
  }
}

@media (min-width: 1024px) {
  .hero__gear-space {
    width: clamp(380px, 38vw, 480px);
    height: clamp(380px, 38vw, 480px);
  }
}

.hero__label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 100px;
  padding: 4px 14px;
  margin-bottom: 20px;
}

.hero__title {
  font-size: clamp(2.2rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__sub {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 36px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(8px); }
}

/* ========================================
   SECTIONS
   ======================================== */
.section {
  padding: 72px 0;
  contain: layout style;
}

.section--alt {
  background: var(--bg-alt);
}

.section__header {
  text-align: center;
  margin-bottom: 48px;
}

.section__title {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section__sub {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ========================================
   ABOUT
   ======================================== */
.about__grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}

.about__photo {
  flex-shrink: 0;
}

.about__avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(124,58,237,0.05));
  border: 2px solid rgba(124,58,237,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.about__text {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.about__text p {
  color: rgba(240,240,240,0.75);
}

.about__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  display: inline-block;
  padding: 5px 14px;
  background: rgba(124,58,237,0.08);
  border: 1px solid rgba(124,58,237,0.18);
  border-radius: 100px;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

/* ========================================
   SERVICES
   ======================================== */
.services__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: rgba(124,58,237,0.25);
}

.service-card__icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: rgba(245,166,35,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.service-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.service-card__text {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.service-card__price {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(245,166,35,0.1);
  border-radius: 100px;
  padding: 4px 12px;
}

/* ========================================
   PORTFOLIO
   ======================================== */
.portfolio__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.portfolio-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  display: flex;
  flex-direction: column;
}

.portfolio-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border-color: rgba(245,166,35,0.3);
}

.portfolio-card__preview {
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #1f1f1f, #2a2a2a);
  overflow: hidden;
  position: relative;
}

.portfolio-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-card__preview img {
  transform: scale(1.04);
}

.portfolio-card__preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.3;
}

.portfolio-card__body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.portfolio-card__name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.portfolio-card__desc {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
  margin-bottom: 16px;
}

.portfolio-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  transition: gap var(--transition);
}

.portfolio-card__link:hover {
  gap: 10px;
}

.portfolio__empty {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 20px;
  grid-column: 1 / -1;
}

/* ========================================
   CONTACT
   ======================================== */
.contact__body {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.contact__channels {
  margin-bottom: 24px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color var(--transition), transform var(--transition);
  text-align: left;
}

.contact-card:hover {
  border-color: rgba(124,58,237,0.3);
  transform: translateY(-2px);
}

.contact-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-card__icon--tg {
  background: #29A7E1;
}

.contact-card__label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.contact-card__value {
  display: block;
  font-weight: 600;
  font-size: 15px;
}

.contact-card__arrow {
  margin-left: auto;
  color: var(--text-muted);
  flex-shrink: 0;
}

.contact__note {
  font-size: 14px;
  color: var(--text-muted);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
  background: #0F0F12;
  border-top: 1px solid var(--border);
  padding: 32px 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.footer__left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer__copy {
  font-size: 13px;
  color: var(--text-muted);
}

/* FAB */
.fab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 16px 28px;
  border-radius: 100px;
  box-shadow: 0 6px 28px rgba(124,58,237,0.35);
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  letter-spacing: 0.01em;
}

.fab:hover {
  background: var(--accent-dark);
  box-shadow: 0 8px 36px rgba(124,58,237,0.5);
  transform: translateY(-2px);
}

.fab:active {
  transform: translateY(0) scale(0.97);
}

/* ========================================
   DESKTOP — md: 768px
   ======================================== */
@media (min-width: 768px) {
  .navbar {
    top: 16px;
    left: 24px;
    right: 24px;
    width: auto;
    max-width: 1100px;
    margin: 0 auto;
    height: 56px;
    border-radius: 100px;
    background: rgba(24,24,27,0.8);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    transition: width 0.45s cubic-bezier(0.4,0,0.2,1),
                background 0.3s ease,
                box-shadow 0.3s ease,
                border-radius 0.3s ease;
  }

  .navbar.scrolled {
    width: calc(100% - 32px);
    background: rgba(24,24,27,0.97);
    box-shadow: 0 12px 40px rgba(0,0,0,0.55);
    border-radius: 100px;
  }

  .navbar__inner { padding: 0 20px; }

  .navbar__burger  { display: none; }
  .mobile-menu     { display: none !important; }

  .navbar__links--desktop {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .nav-cta {
    font-size: 13px;
    padding: 8px 18px;
  }

  /* Hero — горизонтальный layout */
  .hero__layout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .hero__visual { display: flex; }

  .about__grid {
    flex-direction: row;
    align-items: flex-start;
  }

  .services__grid {
    grid-template-columns: 1fr 1fr;
  }

  .portfolio__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .footer__left {
    align-items: flex-start;
  }
}

/* ========================================
   DESKTOP — lg: 1024px
   ======================================== */
@media (min-width: 1024px) {
  .services__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .portfolio__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
  }
}

/* ========================================
   SCROLL REVEAL — базовые стили
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
