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

:root {
  --bg: #20264B;
  --bg-secondary: #252B55;
  --bg-card: #1E2345;
  --bg-elevated: #2A3060;
  --border: #353B6B;
  --border-hover: #4A5080;
  --card-border: var(--border);
  --text-primary: #F2F2F2;
  --text-secondary: #B0B3C9;
  --text-muted: #7A7FA8;
  --accent: #2F358B;
  --accent-hover: #3B42A0;
  --radius: 6px;
  --radius-sm: 4px;
  --transition: 0.2s ease;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --orb-1: rgba(47, 53, 139, 0.12);
  --orb-2: rgba(47, 53, 139, 0.06);
  --particles-color: 242, 242, 242;
}

[data-theme="light"] {
  --bg: #F2F2F2;
  --bg-secondary: #E8E8ED;
  --bg-card: #FFFFFF;
  --bg-elevated: #ECECF0;
  --border: #D4D4DC;
  --border-hover: #B0B3C9;
  --text-primary: #20264B;
  --text-secondary: #555888;
  --text-muted: #8A8DA8;
  --accent: #2F358B;
  --accent-hover: #3B42A0;
  --orb-1: rgba(47, 53, 139, 0.06);
  --orb-2: rgba(47, 53, 139, 0.03);
  --particles-color: 32, 38, 75;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

::selection {
  background: rgba(47, 53, 139, 0.4);
  color: #F2F2F2;
}

/* ========== PARTICLES ========== */
#particles-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  transition: opacity 0.5s ease;
}

/* ========== DOT PATTERN BG ========== */
.dot-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: radial-gradient(var(--text-primary) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* ========== SECTION BG ORBS ========== */
section[data-bg] {
  position: relative;
}

[data-bg]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.section-bg-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease, transform 0.1s linear;
}

.section-bg-orb.visible {
  opacity: 1;
}

.section-bg-orb--1 {
  width: 500px;
  height: 500px;
  background: var(--orb-1);
  top: -15%;
  right: -10%;
  filter: blur(100px);
}

.section-bg-orb--2 {
  width: 400px;
  height: 400px;
  background: var(--orb-2);
  bottom: -10%;
  left: -10%;
  filter: blur(80px);
}

.section-bg-orb--3 {
  width: 300px;
  height: 300px;
  background: var(--orb-1);
  top: 40%;
  left: 50%;
  filter: blur(60px);
}

/* Hero-specific orbs */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0;
  transition: opacity 1.5s ease, transform 0.1s linear;
}

.hero__orb--1 {
  width: 500px;
  height: 500px;
  background: var(--orb-1);
  top: -15%;
  left: 40%;
}

.hero__orb--2 {
  width: 400px;
  height: 400px;
  background: var(--orb-2);
  bottom: -10%;
  left: -10%;
}

.hero.loaded .hero__orb {
  opacity: 1;
}

/* ========== GRID PATTERN ========== */
.section::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 30%, transparent 70%);
}

.section.reveal-bg::after {
  opacity: 0.3;
}

[data-theme="light"] .section::after {
  mask-image: radial-gradient(ellipse at 50% 0%, black 20%, transparent 60%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 20%, transparent 60%);
}

/* ========== CONTAINER ========== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* ========== HEADER ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 0;
  transition: background 0.3s ease, padding 0.3s ease, border-color 0.3s ease;
}

.header.scrolled {
  background: rgba(32, 38, 75, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

[data-theme="light"] .header.scrolled {
  background: rgba(242, 242, 242, 0.85);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header__callback-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.header__callback-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  position: relative;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.theme-toggle__sun,
.theme-toggle__moon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle__moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle__sun {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

[data-theme="light"] .theme-toggle__moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

[data-theme="light"] .theme-toggle__sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo__img {
  display: block;
  height: 44px;
  width: auto;
}

.logo__img--dark {
  display: none;
}

[data-theme="light"] .logo__img--light {
  display: none;
}

[data-theme="light"] .logo__img--dark {
  display: block;
}

/* Navigation */
.nav {
  display: flex;
  gap: 28px;
}

.nav__link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

.nav__link:hover {
  color: var(--text-primary);
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}

.burger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========== HERO ========== */
.hero {
  position: relative;
  min-height: 100vh;          /* fallback */
  min-height: 100dvh;         /* dynamic viewport — учитывает адресную строку Chrome */
  display: flex;
  align-items: center;
  padding: 80px 0;
  overflow: clip;
  max-width: 100vw;
}

.hero__inner {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 40px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero__content {
  text-align: left;
}

.hero__badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 24px;
  animation: fadeInUp 0.6s 0.2s both;
}

.hero__title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -2px;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s 0.3s both;
}

.hero__subtitle {
  max-width: 480px;
  margin-bottom: 32px;
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.7;
  animation: fadeInUp 0.6s 0.4s both;
}

.hero__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  animation: fadeInUp 0.6s 0.5s both;
}

/* ===== Hero Grid BG ===== */
.hero__grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.15;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse at 60% 50%, black 35%, transparent 65%);
  -webkit-mask-image: radial-gradient(ellipse at 60% 50%, black 35%, transparent 65%);
}

/* ===== Code Editor ===== */
.hero__code {
  animation: fadeInUp 0.8s 0.5s both;
  justify-self: end;
  width: 100%;
  max-width: 420px;
  margin-right: -40px;
}

@media (min-width: 1101px) {
  .hero__code {
    width: 150%;
    max-width: 580px;
    margin-right: -120px;
  }
}

.code-editor {
  background: #0D1117;
  border: 1px solid #30363D;
  border-radius: 8px;
  overflow: hidden;
  font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', monospace;
  font-size: 10.5px;
  line-height: 1.6;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  opacity: 0.65;
  transition: opacity 0.4s ease;
}

.hero.loaded .code-editor {
  opacity: 0.85;
}

.code-editor__body {
  display: flex;
  padding: 16px 0;
  min-height: 280px;
}

.code-editor__header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #161B22;
  border-bottom: 1px solid #30363D;
}

.code-editor__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-editor__dot--red { background: #FF5F56; }
.code-editor__dot--yellow { background: #FFBD2E; }
.code-editor__dot--green { background: #27C93F; }

.code-editor__filename {
  margin-left: auto;
  font-size: 11px;
  color: #8B949E;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 500;
}

.code-editor__lines {
  display: flex;
  flex-direction: column;
  padding: 0 14px;
  text-align: right;
  color: #484F58;
  user-select: none;
  border-right: 1px solid #21262D;
  margin-right: 14px;
}

.line-num {
  display: block;
  min-height: 1.6em;
}

.code-editor__content {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.code-line {
  display: block;
  white-space: pre;
  min-height: 1.65em;
}

.code-line--cursor {
  border-right: 2px solid transparent;
  animation: cursorBlink 1s step-end infinite;
}

.code-editor .kw { color: #FF7B72; }
.code-editor .id { color: #D2A8FF; }
.code-editor .cb { color: #79C0FF; }
.code-editor .op { color: #79C0FF; }
.code-editor .str { color: #A5D6FF; }
.code-editor .prop { color: #79C0FF; }
.code-editor .kc { color: #79C0FF; }
.code-editor .co { color: #8B949E; font-style: italic; }
.code-editor .ts { color: #58A6FF; }
.code-editor .ok { color: #3FB950; }
.code-editor .warn { color: #D29922; }

.cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: #79C0FF;
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

[data-theme="light"] .code-editor {
  background: #F6F8FA;
  border-color: #D0D7DE;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .code-editor__header {
  background: #EAEEF2;
  border-color: #D0D7DE;
}

[data-theme="light"] .code-editor__lines {
  color: #AFB8C1;
  border-color: #D0D7DE;
}

[data-theme="light"] .code-editor .kw { color: #CF222E; }
[data-theme="light"] .code-editor .id { color: #8250DF; }
[data-theme="light"] .code-editor .cb { color: #0550AE; }
[data-theme="light"] .code-editor .op { color: #0550AE; }
[data-theme="light"] .code-editor .str { color: #0A3069; }
[data-theme="light"] .code-editor .prop { color: #0550AE; }
[data-theme="light"] .code-editor .kc { color: #0550AE; }
[data-theme="light"] .code-editor .co { color: #6E7781; }
[data-theme="light"] .code-editor .ts { color: #0550AE; }
[data-theme="light"] .code-editor .ok { color: #116329; }
[data-theme="light"] .code-editor .warn { color: #9A6700; }

[data-theme="light"] .cursor { background: #0550AE; }

[data-theme="light"] .code-editor__filename { color: #656D76; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  letter-spacing: -0.2px;
}

.btn--primary {
  background: var(--text-primary);
  color: var(--bg);
}

.btn--primary:hover {
  opacity: 0.85;
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  background: var(--bg-card);
  border-color: var(--border-hover);
}

.btn--wide {
  width: 100%;
  justify-content: center;
  padding: 14px 28px;
}

/* ========== SECTION ========== */
.section {
  padding: 120px 0;
  max-width: 100vw;
  overflow: hidden;
}

.section__header {
  text-align: center;
  margin-bottom: 64px;
}

.section__tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.section__title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.section__title--left {
  text-align: left;
}

.section__desc {
  max-width: 520px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 16px;
}

/* ========== SERVICES ========== */
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.service-card {
  background: var(--bg);
  padding: 36px 32px;
  transition: background var(--transition);
  cursor: default;
}

.service-card:hover {
  background: var(--bg-card);
}

.service-card__icon {
  color: var(--text-primary);
  margin-bottom: 20px;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.service-card:hover .service-card__icon {
  opacity: 1;
}

.service-card__title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  line-height: 1.3;
}

.service-card__desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.service-card__link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color var(--transition);
}

.service-card__link:hover {
  color: var(--text-primary);
}

/* ========== ABOUT ========== */
.about__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about__text {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 32px;
}

.about__features {
  display: grid;
  gap: 12px;
}

.about__feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-secondary);
}

.about__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.stat-card {
  background: var(--bg);
  padding: 36px 28px;
  text-align: center;
  transition: background var(--transition);
}

.stat-card:hover {
  background: var(--bg-card);
}

.stat-card__number {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -2px;
  color: var(--text-primary);
}

.stat-card__plus,
.stat-card__percent {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-left: 1px;
}

.stat-card__label {
  display: block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

/* ========== PROCESS ========== */
.process__timeline {
  max-width: 640px;
  margin: 0 auto;
}

.process__step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 24px;
  padding-bottom: 40px;
  position: relative;
}

.process__step:last-child {
  padding-bottom: 0;
}

.process__step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.process__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-top: 8px;
  position: relative;
  left: 12px;
  transition: background 0.3s ease;
}

.process__step .process__dot {
  background: var(--accent);
}

.process__num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.process__card h3 {
  font-size: 17px;
  font-weight: 600;
  margin: 6px 0 8px;
}

.process__card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

/* ========== TECH STACK ========== */
.stack__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.stack__cat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: background var(--transition);
}

.stack__cat:hover {
  background: var(--bg-elevated);
}

.stack__cat-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 16px;
}

.stack__items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stack__item {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.stack__item:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* ========== AI PLATFORMS ========== */
.ai__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.ai__card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: all var(--transition);
}

.ai__card:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.ai__icon {
  color: var(--text-primary);
  opacity: 0.5;
  margin-bottom: 16px;
  transition: opacity var(--transition);
}

.ai__card:hover .ai__icon {
  opacity: 0.8;
}

.ai__card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.ai__card p {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.7;
}

/* ========== AI INTEGRATION ========== */
.ai-integration {
  position: relative;
}

.ai-int__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.ai-int__card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 32px 28px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.ai-int__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.ai-int__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.ai-int__card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.ai-int__card p {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.7;
}

@media (max-width: 768px) {
  .ai-int__grid {
    grid-template-columns: 1fr;
  }
}

/* ========== AI CHAT SECTION ========== */
.ai-chat__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.ai-chat__content .section__tag {
  margin-bottom: 12px;
}

.ai-chat__title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}

.ai-chat__desc {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 24px;
}

.ai-chat__window {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  min-height: 360px;
}

.ai-chat__window-body {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  min-height: 280px;
  max-height: 360px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.ai-chat__window-body::-webkit-scrollbar {
  width: 4px;
}

.ai-chat__window-body::-webkit-scrollbar-track {
  background: transparent;
}

.ai-chat__window-body::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 10px;
}

.ai-chat__window-body::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

.ai-chat__bubble {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 85%;
  animation: fadeInUp 0.3s both;
}

.ai-chat__bubble--user {
  background: var(--bg-elevated);
  color: var(--text-primary);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-chat__bubble--bot {
  background: var(--accent);
  color: #F2F2F2;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.ai-chat__window-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--card-border);
}

.ai-chat__input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color var(--transition);
}

.ai-chat__input:focus {
  border-color: var(--accent);
}

.ai-chat__input--highlight {
  animation: inputPulse 1s ease 3;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(47, 53, 139, 0.2);
}

@keyframes inputPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(47, 53, 139, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(47, 53, 139, 0.35); }
}

.ai-chat__send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}

.ai-chat__send:hover {
  background: var(--accent-hover);
}

/* ========== CHAT FILE ATTACH ========== */
.ai-chat__file-label {
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  transition: color var(--transition);
  flex-shrink: 0;
}

.ai-chat__file-label:hover {
  color: var(--text-primary);
}

.ai-chat__file {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* ========== CHAT OVERLAY ========== */
.chat-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.chat-overlay.active {
  opacity: 1;
}

#ai-chat {
  position: relative;
  transition: box-shadow 0.3s ease;
}

#ai-chat.chat-focused {
  z-index: 999;
  box-shadow: 0 0 0 4px var(--accent), 0 0 40px rgba(47, 53, 139, 0.2);
  border-radius: 0;
}

@media (max-width: 768px) {
  .ai-chat__inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .ai-chat__title {
    font-size: 24px;
  }
}

/* ========== FORM CONSENT TEXT ========== */
.form__consent {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 12px;
  text-align: center;
}

.form__consent a {
  color: var(--accent);
  text-decoration: underline;
}

/* ========== CALLBACK ========== */
.callback__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.callback__overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.callback__modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 1002;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 40px 32px 32px;
  width: 90%;
  max-width: 420px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}

.callback__modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.callback__close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.callback__modal h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.callback__sub {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 24px;
}

.callback__modal .form__group {
  margin-bottom: 16px;
}

.callback__modal .btn {
  margin-top: 8px;
}

/* ========== ONLINE CONSULTANT BUTTON ========== */
.consultant__btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(47, 53, 139, 0.4);
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.3s, visibility 0.3s;
  opacity: 0;
  visibility: hidden;
}

.consultant__btn--visible {
  opacity: 1;
  visibility: visible;
}

.consultant__btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(47, 53, 139, 0.5);
}

@media (max-width: 480px) {
  .consultant__btn {
    right: 20px;
    bottom: 20px;
  }
}

/* ========== CASES ========== */
.cases__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.case-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.case-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.case-card__tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

.case-card__title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 10px;
}

.case-card__desc {
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.7;
  margin-bottom: 20px;
  flex: 1;
}

.case-card__stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.case-card__num {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -1px;
}

.case-card__label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ========== CONTACT ========== */
.contact__form {
  max-width: 520px;
  margin: 0 auto;
}

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form__group {
  position: relative;
  margin-bottom: 16px;
}

.form__input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-sans);
  transition: all var(--transition);
  outline: none;
}

.form__input:focus {
  border-color: var(--text-muted);
}

.form__input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

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

/* ========== FILE INPUT ========== */
.form__file-wrapper {
  position: relative;
}

.form__file {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 2;
}

.form__file-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.form__file-label:hover {
  border-color: var(--border-hover);
  color: var(--text-secondary);
}

.form__file-label svg {
  flex-shrink: 0;
  opacity: 0.5;
}

.form__file-name {
  color: var(--text-secondary);
  font-size: 12px;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

/* ========== FOOTER ========== */
.footer {
  padding: 48px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.footer__brand {
  text-align: center;
}

.footer__brand p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 4px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
}

.footer__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  transition: color var(--transition);
}

.footer__links a:hover {
  color: var(--text-primary);
}

.footer__copy {
  color: var(--text-muted);
  font-size: 12px;
  width: 100%;
  text-align: center;
  margin-top: 24px;
}

/* ========== REVEAL ANIMATIONS ========== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[style*="--i"] {
  transition-delay: calc(var(--i) * 0.08s);
}

/* ========== KEYFRAMES ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes typingPulse {
  0%, 100% { border-color: transparent; }
  50% { border-color: var(--accent); }
}

/* ========== MOBILE ========== */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }
  .hero__content {
    text-align: center;
  }
  .hero__subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  .hero__actions {
    justify-content: center;
  }
  .hero__code {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    justify-self: center;
    margin-right: 0;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }

  .header__actions {
    gap: 8px;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 240px;
    height: 100vh;
    background: rgba(32, 38, 75, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 80px 28px 32px;
    gap: 20px;
    transition: right var(--transition);
    z-index: 99;
    border-left: 1px solid var(--border);
  }

  [data-theme="light"] .nav {
    background: rgba(242, 242, 242, 0.98);
  }

  .nav.open {
    right: 0;
  }

  .burger {
    display: flex;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero__content {
    text-align: center;
  }

  .hero__subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__title {
    font-size: 36px;
    letter-spacing: -1.5px;
  }

  .hero__subtitle {
    font-size: 15px;
  }

  .hero__code {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    justify-self: center;
    margin-right: 0;
  }

  .code-editor {
    font-size: 10px;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .form__row {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 80px 0;
  }

  .services__grid {
    grid-template-columns: 1fr;
  }

  .stack__grid {
    grid-template-columns: 1fr;
  }

  .ai__grid {
    grid-template-columns: 1fr;
  }

  .cases__grid {
    grid-template-columns: 1fr;
  }

  .stat-card__number {
    font-size: 32px;
  }
}

@media (max-width: 640px) {
  .footer__inner {
    flex-direction: column;
    text-align: center;
  }

  .footer__links {
    width: 100%;
  }
}

@media (max-width: 530px) {
  .hero__code {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: 30px;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    justify-content: center;
  }
}

/* ========== CURSOR FOLLOWER ========== */
.cursor-follower {
  position: fixed;
  top: 0; left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 53, 139, 0.25) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease, width 0.3s ease, height 0.3s ease;
  mix-blend-mode: screen;
}

.cursor-follower--grow {
  width: 64px;
  height: 64px;
  background: radial-gradient(circle, rgba(47, 53, 139, 0.35) 0%, transparent 70%);
}

[data-theme="light"] .cursor-follower {
  background: radial-gradient(circle, rgba(47, 53, 139, 0.15) 0%, transparent 70%);
  mix-blend-mode: multiply;
}

[data-theme="light"] .cursor-follower--grow {
  background: radial-gradient(circle, rgba(47, 53, 139, 0.25) 0%, transparent 70%);
}

@media (hover: none) and (pointer: coarse) {
  .cursor-follower { display: none; }
}
