/* ============================================
   AI-Integrator.kz — Design System
   ============================================ */

:root {
  --bg: #080A0F;
  --surface: #0E1118;
  --surface-hover: #141820;
  --accent: #C8A96E;
  --accent-dim: rgba(200, 169, 110, 0.15);
  --accent-glow: rgba(200, 169, 110, 0.25);
  --text: #E8E9EC;
  --muted: #7A7D85;
  --border: rgba(255, 255, 255, 0.06);
  --border-accent: rgba(200, 169, 110, 0.3);

  --font-display: 'Syne', sans-serif;
  --font-body: 'Inter', sans-serif;

  --container: 1200px;
  --container-wide: 1400px;
  --radius: 12px;
  --radius-lg: 20px;

  --nav-height: 72px;
  --transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

ul, ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

/* Noise overlay */
.noise {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.container--wide {
  max-width: var(--container-wide);
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
  max-width: 65ch;
  color: var(--muted);
  font-weight: 300;
}

.text-accent {
  color: var(--accent);
}

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

/* Section */
.section {
  padding-block: clamp(4rem, 10vw, 8rem);
  position: relative;
}

.section__header {
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.section__tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section__title {
  margin-bottom: 1rem;
}

.section__subtitle {
  font-size: 1.125rem;
  max-width: 55ch;
}

/* Geometric decor */
.geo-lines {
  position: absolute;
  pointer-events: none;
  opacity: 0.12;
}

.geo-lines--right {
  top: 10%;
  right: 0;
  width: 200px;
  height: 400px;
}

.geo-lines--left {
  bottom: 10%;
  left: 0;
  width: 150px;
  height: 300px;
}

/* ============================================
   Navigation
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  transition: background var(--transition), backdrop-filter var(--transition), border-color var(--transition);
  border-bottom: 1px solid transparent;
}

.nav--scrolled {
  background: rgba(8, 10, 15, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 2rem;
}

.nav__logo img {
  height: 40px;
  width: auto;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__link {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  padding: 0.5rem 0.875rem;
  border-radius: 6px;
  transition: color var(--transition-fast), background var(--transition-fast);
}

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

.nav__link--active {
  color: var(--accent);
}

.nav__cta {
  flex-shrink: 0;
}

.nav__burger {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background var(--transition-fast);
}

.nav__burger:hover {
  background: var(--surface);
}

.nav__burger svg {
  width: 22px;
  height: 22px;
  stroke: var(--text);
  stroke-width: 1.5;
  fill: none;
}

.nav__burger .icon-close {
  display: none;
}

.nav__burger.is-open .icon-menu {
  display: none;
}

.nav__burger.is-open .icon-close {
  display: block;
}

/* Mobile nav */
@media (max-width: 900px) {
  .nav__burger {
    display: flex;
    order: 3;
  }

  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 1.5rem;
    background: rgba(8, 10, 15, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transform: translateX(100%);
    transition: transform var(--transition);
    z-index: 999;
  }

  .nav__links.is-open {
    transform: translateX(0);
  }

  .nav__link {
    font-size: 1.125rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
  }

  .nav__cta {
    display: none;
  }

  .nav__links .nav__cta-mobile {
    display: block;
    margin-top: 1.5rem;
    text-align: center;
  }
}

@media (min-width: 901px) {
  .nav__cta-mobile {
    display: none !important;
  }
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 400;
  padding: 0.875rem 1.75rem;
  border-radius: 8px;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
  font-weight: 400;
}

.btn--primary:hover {
  background: #d4b87e;
}

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

.btn--ghost:hover {
  border-color: var(--border-accent);
  color: var(--accent);
}

.btn--sm {
  font-size: 0.8125rem;
  padding: 0.625rem 1.25rem;
}

.btn__arrow {
  transition: transform var(--transition-fast);
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* ============================================
   Hero
   ============================================ */
.hero {
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  top: 20%;
  left: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse at center, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(60px);
  opacity: 0.6;
}

.hero__glow--secondary {
  top: auto;
  bottom: 10%;
  left: auto;
  right: -5%;
  width: 40%;
  height: 40%;
  opacity: 0.3;
}

.hero-text {
  width: 42%;
  padding: 0 48px;
  z-index: 2;
  position: relative;
}

.hero-canvas-wrap {
  width: 58%;
  height: 100vh;
  height: 100dvh;
  position: relative;
}

#comet-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: grab;
}

#comet-canvas:active {
  cursor: grabbing;
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
  }

  .hero-text {
    width: 100%;
    padding: 120px 24px 24px;
  }

  .hero-canvas-wrap {
    width: 100%;
    height: 400px;
  }
}

.hero__tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-accent);
  border-radius: 100px;
}

.hero__title {
  margin-bottom: 1.5rem;
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 2.5rem;
  max-width: 60ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============================================
   Stats / Counters
   ============================================ */
.stats {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.stat {
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
  text-align: center;
  position: relative;
}

.stat:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 25%;
  height: 50%;
  width: 1px;
  background: var(--border);
}

.stat__number {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 300;
  max-width: 20ch;
  margin-inline: auto;
}

@media (max-width: 640px) {
  .stats__grid {
    grid-template-columns: 1fr;
  }

  .stat:not(:last-child)::after {
    right: 25%;
    top: auto;
    bottom: 0;
    width: 50%;
    height: 1px;
  }
}

/* ============================================
   Steps
   ============================================ */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
}

.step {
  position: relative;
  padding-top: 1rem;
}

.step__number {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
}

.step__title {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.step__text {
  font-size: 0.9375rem;
}

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

/* ============================================
   Cards
   ============================================ */
.cards {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.cards--2 {
  grid-template-columns: repeat(2, 1fr);
}

.cards--3 {
  grid-template-columns: repeat(3, 1fr);
}

.cards--4 {
  grid-template-columns: repeat(2, 1fr);
}

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

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
  overflow: hidden;
  transition: background var(--transition), border-color var(--transition), transform var(--transition-fast);
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 0;
  background: var(--accent);
  transition: height var(--transition);
  z-index: 2;
}

.card:hover::before {
  height: 100%;
}

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, transparent 40%, var(--accent) 50%, transparent 60%);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}

.card:hover {
  background: var(--surface-hover);
  border-color: var(--border-accent);
}

.card:hover::after {
  opacity: 1;
  animation: gradient-border 3s ease infinite;
}

@keyframes gradient-border {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.card__category {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.card__title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.card__metric {
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.card__icon {
  width: 40px;
  height: 40px;
  margin-bottom: 1.25rem;
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
}

.card__number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1rem;
  opacity: 0.4;
}

.card__text {
  font-size: 0.9375rem;
}

.cards--portfolio {
  grid-template-columns: repeat(2, 1fr);
}

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

@media (max-width: 640px) {
  .cards--2,
  .cards--3,
  .cards--portfolio {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   CTA Section
   ============================================ */
.cta {
  text-align: center;
  position: relative;
}

.cta__inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(3rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem);
  position: relative;
  overflow: hidden;
}

.cta__inner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 100%;
  background: radial-gradient(ellipse at center, var(--accent-dim) 0%, transparent 70%);
  pointer-events: none;
}

.cta__title {
  position: relative;
  margin-bottom: 0.75rem;
}

.cta__price {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 2rem;
  position: relative;
}

.cta .btn {
  position: relative;
}

/* ============================================
   Media placeholder
   ============================================ */
.social-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 700px;
  margin-inline: auto;
}

.social-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), transform var(--transition-fast);
}

.social-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

.social-card svg {
  width: 32px;
  height: 32px;
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
}

.social-card span {
  font-size: 0.875rem;
  color: var(--muted);
}

.media-placeholder {
  text-align: center;
  margin-top: 3rem;
  font-size: 1.125rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .social-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   Footer
   ============================================ */
.footer {
  border-top: 1px solid var(--border);
  padding-block: clamp(3rem, 5vw, 4rem);
  background: var(--surface);
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}

.footer__brand img {
  height: 36px;
  margin-bottom: 0.75rem;
}

.footer__brand p {
  font-size: 0.875rem;
}

.footer__contact {
  text-align: right;
}

.footer__phone {
  display: block;
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: 1.25rem;
  transition: color var(--transition-fast);
}

.footer__phone:hover {
  color: var(--accent);
}

.footer__socials {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.footer__social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.footer__social:hover {
  border-color: var(--border-accent);
  background: var(--accent-dim);
}

.footer__social svg {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  stroke-width: 1.5;
  fill: none;
  transition: stroke var(--transition-fast);
}

.footer__social:hover svg {
  stroke: var(--accent);
}

.footer__copy {
  grid-column: 1 / -1;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .footer__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer__contact {
    text-align: center;
  }

  .footer__socials {
    justify-content: center;
  }
}

/* ============================================
   Page hero (inner pages)
   ============================================ */
.page-hero {
  padding-top: calc(var(--nav-height) + 4rem);
  padding-bottom: 3rem;
  position: relative;
}

.page-hero .section__subtitle {
  margin-top: 1rem;
}

/* Floating WhatsApp */
.wa-float {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.35);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.wa-float:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(37, 211, 102, 0.45);
}

.wa-float:active {
  transform: scale(0.96);
}

.wa-float svg {
  width: 28px;
  height: 28px;
  fill: #fff;
}

/* Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* GSAP initial states */
.gsap-hidden {
  opacity: 0;
  transform: translateY(30px);
}
