:root {
  --bg: #05070a;
  --bg-alt: #0a0f14;
  --text: #e8f0f0;
  --text-dim: #8a9a9c;
  --accent: #2dd4bf;
  --accent-bright: #5eead4;
  --border: rgba(255,255,255,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
  cursor: default;
}

#scene {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

.grain {
  position: fixed; inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image: radial-gradient(circle at 50% 0%, rgba(45,212,191,0.06), transparent 60%);
}

h1, h2, h3, .nav-logo, .btn-primary, .btn-ghost {
  font-family: 'Space Grotesk', sans-serif;
}

main, header, footer { position: relative; z-index: 2; }

/* Reusable glass surface, ties nav / hero-stats / pricing-tabs together */
.glass-panel {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
}

/* Nav — floating glass pill */
.nav-wrap {
  position: fixed;
  top: 18px; left: 0; right: 0;
  display: flex;
  justify-content: center;
  z-index: 50;
  padding: 0 24px;
}
.nav {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  border-radius: 100px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.nav-logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.12em;
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  border: 1px solid var(--accent);
  color: var(--accent-bright) !important;
  padding: 8px 18px;
  border-radius: 100px;
  transition: background 0.2s, color 0.2s;
}
.nav-cta:hover { background: var(--accent); color: var(--bg) !important; }

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 48px;
  position: relative;
}
.hero-inner { max-width: 900px; }
.hero-eyebrow {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 24px;
  font-weight: 500;
}
.hero-title {
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1.05;
  font-weight: 700;
  display: flex;
  flex-direction: column;
}
.hero-title .accent { color: var(--text-dim); }
.hero-sub {
  margin-top: 28px;
  max-width: 540px;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-dim);
}
.hero-actions { margin-top: 40px; display: flex; gap: 16px; flex-wrap: wrap; }

.hero-stats {
  margin-top: 48px;
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 20px 32px;
  border-radius: 18px;
  flex-wrap: wrap;
}
.hero-stat { display: flex; flex-direction: column; gap: 4px; }
.hero-stat-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-bright);
}
.hero-stat-num i { font-style: normal; font-size: 13px; color: var(--text-dim); font-weight: 500; }
.hero-stat-label { font-size: 12px; color: var(--text-dim); max-width: 140px; line-height: 1.4; }
.hero-stat-divider { width: 1px; height: 34px; background: var(--border); }
@media (max-width: 640px) {
  .hero-stats { flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-stat-divider { display: none; }
}

.btn-primary, .btn-ghost {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 30px rgba(45,212,191,0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(45,212,191,0.55); }
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-bright); }

.scroll-hint {
  position: absolute;
  bottom: 40px; left: 48px;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-dim);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.scroll-hint span {
  width: 1px; height: 32px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  display: block;
}

/* Marquee */
.marquee {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: 18px 0;
  background: rgba(255,255,255,0.02);
}
.marquee-track {
  display: flex;
  gap: 24px;
  white-space: nowrap;
  width: max-content;
  animation: scroll-left 28s linear infinite;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}
.marquee-track span:nth-child(2n) { color: var(--accent); }
@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Sections generic */
section:not(.hero):not(.marquee) { padding: 140px 48px; max-width: 1200px; margin: 0 auto; }
.section-eyebrow {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 14px;
  font-weight: 500;
}
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  margin-bottom: 56px;
  max-width: 700px;
}

/* Services — bento grid: one tall featured card + two stacked */
.service-bento {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  grid-template-rows: repeat(2, auto);
  gap: 24px;
}
.service-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  background: rgba(255,255,255,0.02);
  transition: border-color 0.25s, transform 0.25s;
}
.service-card-tall { grid-row: 1 / 3; display: flex; flex-direction: column; justify-content: center; }
.service-card:hover { border-color: var(--accent); transform: translateY(-4px); }
@media (max-width: 900px) {
  .service-bento { grid-template-columns: 1fr; grid-template-rows: auto; }
  .service-card-tall { grid-row: auto; }
}
.service-num {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 20px;
  opacity: 0.7;
}
.service-card h3 { font-size: 20px; margin-bottom: 12px; }
.service-card p { color: var(--text-dim); font-size: 14px; line-height: 1.6; }

/* Flow diagram: Сайт → CRM → Автоматизация, pure CSS, no JS dependency */
.flow-wrap { margin-top: 72px; }
.flow-caption {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  letter-spacing: 0.02em;
  margin-bottom: 32px;
}
.flow-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 40px 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: radial-gradient(circle at 50% 120%, rgba(45,212,191,0.07), transparent 65%);
}
.flow-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-width: 96px;
}
.flow-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(45,212,191,0.06);
  box-shadow: 0 0 24px rgba(45,212,191,0.18);
  color: var(--accent-bright);
  animation: flow-node-pulse 3.2s ease-in-out infinite;
}
.flow-icon svg { width: 26px; height: 26px; }
.flow-node:nth-child(3) .flow-icon { animation-delay: 0.6s; }
.flow-node:nth-child(5) .flow-icon { animation-delay: 1.2s; }
.flow-node span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}
.flow-connector {
  position: relative;
  flex: 1;
  max-width: 140px;
  height: 2px;
  margin: 0 -6px;
  align-self: flex-start;
  margin-top: 27px;
}
.flow-line {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent), rgba(45,212,191,0.15));
  opacity: 0.5;
}
.flow-pulse {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 10px 2px rgba(94,234,212,0.7);
  transform: translate(-50%, -50%);
  animation: flow-pulse-move 2.4s linear infinite;
}
.flow-pulse-delay { animation-delay: 1.2s; }
@keyframes flow-pulse-move {
  0% { left: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
@keyframes flow-node-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(45,212,191,0.18); }
  50% { box-shadow: 0 0 34px rgba(45,212,191,0.4); }
}
@keyframes flow-pulse-move-v {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

@media (max-width: 700px) {
  .flow-diagram { flex-direction: column; padding: 32px 16px; }
  .flow-connector {
    width: 2px;
    height: 48px;
    max-width: none;
    margin: 4px 0;
    align-self: center;
  }
  .flow-line { background: linear-gradient(180deg, var(--accent), rgba(45,212,191,0.15)); }
  .flow-pulse { top: 0; left: 50%; animation-name: flow-pulse-move-v; }
}

/* Work */
.work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.work-card {
  display: block;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(45,212,191,0.05), transparent 60%);
  transition: border-color 0.25s, transform 0.15s ease-out;
  text-decoration: none;
  color: inherit;
  will-change: transform;
}
.work-card:hover { border-color: var(--accent); }
.work-card:not([data-tilt]):hover { transform: translateY(-4px); }
.work-card-featured { grid-column: span 2; }
.work-card-featured .browser-preview { height: 180px; }
.work-card-featured .preview-icon { width: 52px; height: 52px; }
.work-card-featured h3 { font-size: 26px; }
@media (max-width: 1100px) {
  .work-card-featured { grid-column: span 2; }
}
@media (max-width: 700px) {
  .work-card-featured { grid-column: span 1; }
  .work-card-featured .browser-preview { height: 116px; }
  .work-card-featured .preview-icon { width: 38px; height: 38px; }
  .work-card-featured h3 { font-size: 20px; }
}

/* Browser-window 3D mockup inside each portfolio card */
.browser-mock {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 24px;
  background: var(--bg-alt);
}
.browser-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 10px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
.browser-bar .dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.15); flex-shrink: 0; }
.browser-url {
  margin-left: 6px;
  font-size: 10px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.04);
  padding: 3px 10px;
  border-radius: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.browser-preview {
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(45,212,191,0.15), transparent 60%),
    linear-gradient(160deg, rgba(45,212,191,0.06), transparent 70%);
}
.preview-icon { width: 38px; height: 38px; color: var(--accent-bright); opacity: 0.9; }
.browser-mock-soon .browser-preview { opacity: 0.45; }
.work-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-bright);
  border: 1px solid var(--accent);
  border-radius: 100px;
  padding: 4px 12px;
  margin-bottom: 20px;
}
.work-card h3 { font-size: 20px; margin-bottom: 10px; }
.work-card p { color: var(--text-dim); font-size: 14px; line-height: 1.6; margin-bottom: 18px; }
.work-link { font-size: 13px; color: var(--accent-bright); font-weight: 500; }
.work-card-soon { cursor: default; opacity: 0.55; }
.work-card-soon:hover { border-color: var(--border); transform: none; }
.work-link-soon { color: var(--text-dim); }

/* Pricing tabs */
.price-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 6px;
  border-radius: 100px;
  margin-bottom: 48px;
}
.price-tab {
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.price-tab:hover { color: var(--text); }
.price-tab.active { background: var(--accent); color: var(--bg); }
.price-tab-panel-hidden { display: none; }

/* Pricing — service menu list, same visual language as the rest of the site */
.price-group { margin-bottom: 44px; }
.price-group:last-of-type { margin-bottom: 0; }
.price-group-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}
.price-menu { display: flex; flex-direction: column; }
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.price-row:first-child { border-top: 1px solid var(--border); }
.price-row-highlight { background: linear-gradient(90deg, rgba(45,212,191,0.06), transparent 60%); }
.price-row-main h3 { font-size: 18px; margin-bottom: 6px; }
.price-row-main p { color: var(--text-dim); font-size: 14px; max-width: 520px; line-height: 1.5; }
.price-row-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-bright);
  white-space: nowrap;
  text-align: right;
}
.price-row-value span { font-size: 13px; font-weight: 500; color: var(--text-dim); }
.pricing-note { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 32px; }

@media (max-width: 640px) {
  .price-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .price-row-value { text-align: left; }
}

/* Process — horizontal connected stepper, same visual language as the flow diagram */
.process-track {
  display: flex;
  align-items: flex-start;
}
.process-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.process-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  background: rgba(45,212,191,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  color: var(--accent-bright);
  box-shadow: 0 0 20px rgba(45,212,191,0.15);
  flex-shrink: 0;
}
.process-step h3 { font-size: 18px; }
.process-step p { color: var(--text-dim); font-size: 13.5px; line-height: 1.55; }
.process-connector { margin-top: 23px; max-width: none; flex-shrink: 1; }

@media (max-width: 900px) {
  .process-track { flex-direction: column; align-items: stretch; gap: 8px; }
  .process-connector {
    width: 2px; height: 32px; margin: 0 0 0 23px;
  }
  .process-connector .flow-line { background: linear-gradient(180deg, var(--accent), rgba(45,212,191,0.15)); }
  .process-connector .flow-pulse { top: 0; left: 50%; animation-name: flow-pulse-move-v; }
}

/* Contact */
.contact { text-align: center; }
.contact .section-title { margin-left: auto; margin-right: auto; }
.contact-sub {
  color: var(--text-dim);
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto 36px;
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  padding: 32px 48px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.05em;
}

/* Reveal animation: visible by default (progressive enhancement).
   JS adds .js-anim which hides elements just before animating them in —
   if JS/GSAP fails to load for any reason, content stays visible. */
.js-anim .reveal { opacity: 0; transform: translateY(24px); }

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

@media (max-width: 900px) {
  .nav-links a:not(.nav-cta) { display: none; }
  .work-grid { grid-template-columns: 1fr; }
  section:not(.hero):not(.marquee) { padding: 90px 24px; }
  .hero {
    padding: 130px 24px 110px;
    min-height: auto;
    justify-content: flex-start;
  }
  .scroll-hint { position: static; margin-top: 40px; }
  .nav { padding: 14px 20px; }
  .nav-wrap { top: 12px; }
}
