/* ============ БАЗА ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #060B18;
  --bg-2: #0A0F1E;
  --cyan: #00D4FF;
  --blue: #0055FF;
  --text: #E6F1FF;
  --muted: #8A9BB8;
  --glass: rgba(0, 212, 255, 0.06);
  --border: rgba(0, 212, 255, 0.18);
  --danger: #ff8b8b;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  color-scheme: dark;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; line-height: 1.2; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

html.booting main,
html.booting footer { opacity: 0; }

/* Фонове світіння + сітка */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(0, 212, 255, 0.15), transparent 45%),
    radial-gradient(circle at 80% 90%, rgba(0, 85, 255, 0.15), transparent 45%),
    linear-gradient(180deg, #060B18 0%, #0A0F1E 100%);
  z-index: -2;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(0,212,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.05) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 80%);
  z-index: -1;
  pointer-events: none;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============ HEADER ============ */
header {
  position: fixed; top: 0; left: 0; right: 0;
  padding: 18px 0;
  backdrop-filter: blur(14px);
  background: rgba(6, 11, 24, 0.7);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
  z-index: 100;
}
header.scrolled { border-bottom-color: var(--border); }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.logo {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}
.logo img { height: 42px; width: auto; display: block; }
.footer-brand .logo img { height: 96px; }
.nav-links { display: flex; gap: 32px; font-size: 14px; align-items: center; }
.nav-links a:not(.btn) { color: var(--muted); transition: color .3s; font-weight: 500; }
.nav-links a:not(.btn):hover,
.nav-links a.is-active { color: var(--cyan); }
.nav-links .btn { display: none; }
.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 8px;
  font-weight: 600; font-size: 14px;
  cursor: pointer; border: none;
  transition: all .3s;
  font-family: 'Inter', sans-serif;
}
.btn:disabled { opacity: 0.7; cursor: progress; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, #00D4FF, #0055FF);
  color: #fff;
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.4);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.7);
}
.btn-primary:disabled:hover { transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 6px;
}
.burger span { width: 26px; height: 2px; background: var(--cyan); display: block; }

/* ============ HERO ============ */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding-top: 100px;
  position: relative;
}
.hero-inner { max-width: 820px; }
.badge {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px; letter-spacing: 2px;
  color: var(--cyan);
  margin-bottom: 24px;
  background: var(--glass);
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 24px;
}
.hero h1 span {
  background: linear-gradient(135deg, #00D4FF, #0055FF);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 40px;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

/* ============ СЕКЦІЇ ============ */
section { padding: 110px 0; position: relative; }
.section-tag {
  font-size: 12px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 16px; display: block;
}
.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700; margin-bottom: 20px;
  letter-spacing: -0.5px;
}
.section-sub {
  color: var(--muted); max-width: 620px; margin-bottom: 60px;
  font-size: 1.05rem;
}
.center-copy { text-align: center; }
.center-copy .section-sub { margin-left: auto; margin-right: auto; }

/* ============ STATS ============ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  padding: 40px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--glass);
  margin-top: 60px;
}
.stat { text-align: center; }
.stat b {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.6rem; font-weight: 700;
  background: linear-gradient(135deg, #00D4FF, #0055FF);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat span { font-size: 13px; color: var(--muted); letter-spacing: 1px; }

/* ============ SERVICES ============ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}
.service {
  padding: 36px 30px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(0,212,255,0.04), rgba(0,85,255,0.02));
  transition: all .4s;
  position: relative; overflow: hidden;
}
.service::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, #00D4FF, #0055FF);
  transform: scaleX(0); transform-origin: left;
  transition: transform .4s;
}
.service:hover { transform: translateY(-6px); border-color: var(--cyan); }
.service:hover::before { transform: scaleX(1); }
.service-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0,212,255,0.2), rgba(0,85,255,0.1));
  border: 1px solid var(--border);
  margin-bottom: 22px;
  font-size: 22px;
  color: var(--cyan);
}
.service-icon svg { width: 22px; height: 22px; display: block; }
a.service { display: block; color: inherit; }
.service h3 { font-size: 1.25rem; margin-bottom: 12px; color: var(--text); }
.service p { color: var(--muted); font-size: 14.5px; }
.service-icon.mark {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--cyan);
}
.more {
  display: inline-block;
  margin-top: 18px;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 600;
}
.page-hero { padding-top: 150px; padding-bottom: 10px; }
.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 20px;
}
.page-hero h1 span {
  background: linear-gradient(135deg, #00D4FF, #0055FF);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-hero .lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 680px;
  margin-bottom: 32px;
}
.related { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.related a {
  color: var(--cyan);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 8px 16px;
  font-size: 14px;
}

/* ============ TECH ============ */
.tech-grid {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center;
}
.tech {
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 14px;
  color: var(--muted);
  background: var(--glass);
  transition: all .3s;
}
.tech:hover { color: var(--cyan); border-color: var(--cyan); transform: scale(1.05); }

/* ============ PROCESS ============ */
.process { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; counter-reset: step; }
.step {
  padding: 32px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--glass);
  position: relative;
}
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.4rem; font-weight: 700;
  color: rgba(0, 212, 255, 0.25);
  display: block; margin-bottom: 14px;
}
.step h4 { font-size: 1.1rem; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 14px; }

/* ============ CASES ============ */
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.case {
  padding: 32px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(0,212,255,0.05), transparent);
  transition: all .4s;
}
.case:hover { border-color: var(--cyan); transform: translateY(-4px); }
.case-tag {
  display: inline-block; font-size: 11px; letter-spacing: 2px;
  color: var(--cyan); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 100px; margin-bottom: 18px;
}
.case h3 { font-size: 1.2rem; margin-bottom: 14px; }
.case p { color: var(--muted); font-size: 14.5px; margin-bottom: 20px; }
.case-result {
  font-weight: 600;
  color: var(--cyan);
  font-size: 15px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ============ CONTACT ============ */
.contact {
  max-width: 720px; margin: 0 auto;
  padding: 60px 40px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, rgba(0,212,255,0.08), rgba(0,85,255,0.03));
  box-shadow: 0 0 60px rgba(0, 212, 255, 0.1);
}
.contact form { display: grid; gap: 16px; margin-top: 32px; position: relative; }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; color: var(--muted); }
.contact input, .contact textarea {
  width: 100%;
  padding: 14px 18px;
  background: rgba(6, 11, 24, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit; font-size: 15px;
  transition: border-color .3s;
  resize: vertical;
}
.contact input:focus, .contact textarea:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}
.contact .btn-primary { width: 100%; padding: 16px; font-size: 16px; }
.form-status { min-height: 1.4em; text-align: center; font-size: 14px; }
.form-status.ok { color: var(--cyan); }
.form-status.err { color: var(--danger); }
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.noscript {
  max-width: 720px;
  margin: 120px auto 40px;
  padding: 0 24px;
  color: var(--muted);
  text-align: center;
}

/* ============ FOOTER ============ */
footer {
  padding: 60px 0 30px;
  border-top: 1px solid var(--border);
  margin-top: 80px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 40px; margin-bottom: 40px;
}
.footer-grid h4 { font-size: 13px; letter-spacing: 2px; color: var(--muted); margin-bottom: 18px; text-transform: uppercase; }
.footer-grid ul { list-style: none; display: grid; gap: 12px; }
.footer-grid ul a { color: var(--muted); font-size: 14px; transition: color .3s; }
.footer-grid ul a:hover { color: var(--cyan); }
.footer-brand p { color: var(--muted); font-size: 14px; max-width: 340px; margin-top: 14px; }
.copyright {
  padding-top: 30px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  color: var(--muted); font-size: 13px;
}

/* ============ АНІМАЦІЯ ПОЯВИ ============ */
.js .reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity .8s ease, transform .8s ease;
}
.js .reveal.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .service, .case, .tech, .btn-primary { transition: none; }
}

/* ============ МОБІЛЬНА ============ */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav > .nav-cta { display: none; }
  .burger { display: flex; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(6, 11, 24, 0.98);
    padding: 24px; gap: 20px;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
  }
  .nav-links.open .btn { display: inline-block; }
  section { padding: 70px 0; }
  .contact { padding: 40px 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; text-align: center; }
}
