:root {
  --bg: #f7f8fd;
  --text: #090a1a;
  --muted: #5d6278;
  --card: #ffffff;
  --line: rgba(16, 18, 40, 0.08);
  --purple: #6a45ff;
  --purple-2: #8a63ff;
  --soft: #efeaff;
  --chip: #f3f4fb;
  --shadow: 0 20px 50px rgba(72, 52, 150, 0.08);
  --nav: rgba(255, 255, 255, 0.88);
  --glow: rgba(122, 92, 255, 0.18);
  --hero-card: #fbfbfe;
  --ok: #1f9d62;
  --err: #c2354e;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0c0e18;
  --text: #f4f5fb;
  --muted: #a8adc4;
  --card: #161826;
  --line: rgba(255, 255, 255, 0.08);
  --soft: rgba(122, 92, 255, 0.18);
  --chip: #222538;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  --nav: rgba(18, 20, 34, 0.88);
  --glow: rgba(122, 92, 255, 0.28);
  --hero-card: #141626;
  --ok: #34d399;
  --err: #fb7185;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea { font: inherit; }
section { scroll-margin-top: 110px; }

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(var(--glow) 1.1px, transparent 1.1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 15%, transparent 72%);
}
.glow {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.22), transparent 68%);
}
.glow.a { top: -160px; left: -120px; }
.glow.b { top: 240px; right: -180px; }

.wrap {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 12px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
}
.header-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: nowrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 168px;
}
.mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(145deg, #7a5cff, #4f46e5);
  box-shadow: 0 8px 20px rgba(90, 70, 220, 0.28);
}
.brand-copy strong { display: block; letter-spacing: 0.08em; font-size: 13px; line-height: 1.1; }
.brand-copy span { display: block; color: var(--muted); font-size: 10px; letter-spacing: 0.14em; }

.nav-shell {
  flex: 1;
  display: flex;
  justify-content: center;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 12px;
}
.nav a.active,
.nav a:hover { background: var(--soft); color: var(--purple); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.icon-btn, .menu-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
}
.menu-btn { display: none; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 13px 20px;
  font-weight: 700;
}
.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #7d5cff, #6846f5);
  box-shadow: 0 10px 24px rgba(104, 70, 245, 0.28);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero { padding: 42px 0 20px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 42px;
  align-items: center;
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(31, 157, 98, 0.15);
}
h1 {
  margin: 0 0 16px;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
}
.grad {
  background: linear-gradient(90deg, #5b46f0, #7c5cff 55%, #4f7dff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead { margin: 0 0 26px; color: var(--muted); font-size: 18px; max-width: 560px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.tech-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.chip {
  background: var(--chip);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}

.stage {
  background: var(--hero-card);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 16px;
  position: relative;
}
.stage-top, .stage-bottom {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.float-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  font-size: 12px;
}
.float-card b { display: block; font-size: 13px; }
.float-card span { color: var(--muted); }
.core-view { height: 360px; position: relative; }
.core-view canvas { display: block; }
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 80;
  pointer-events: none;
}
.scroll-progress i {
  display: block;
  height: 100%;
  width: 0;
  position: relative;
  background: linear-gradient(90deg, #7c3aed 0%, #6366f1 50%, #3b82f6 85%, #06b6d4 100%);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.7), 0 0 20px rgba(59, 130, 246, 0.4);
}
.scroll-progress i::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translate(40%, -50%);
  background: #67e8f9;
  box-shadow: 0 0 10px #22d3ee;
  animation: scroll-pulse 1.4s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { opacity: 0.55; transform: translate(40%, -50%) scale(0.85); }
  50% { opacity: 1; transform: translate(40%, -50%) scale(1.15); }
}
.cursor-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}
.bg-shapes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-shapes canvas { display: block; width: 100%; height: 100%; }
@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor body, html.has-cursor a, html.has-cursor button { cursor: none; }
  html.has-cursor input, html.has-cursor textarea, html.has-cursor select { cursor: text; }
}
.mini-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.stage h2 { margin: 10px 0 0; font-size: 22px; letter-spacing: -0.03em; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 28px 0 10px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
  box-shadow: var(--shadow);
}
.stat strong { display: block; font-size: 36px; letter-spacing: -0.04em; }
.stat h3 { margin: 4px 0; font-size: 16px; }
.stat p { margin: 0; color: var(--muted); font-size: 14px; }

.section { padding: 78px 0 10px; }
.kicker {
  color: var(--purple);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}
.section h2 {
  margin: 8px 0 10px;
  font-size: clamp(32px, 4vw, 48px);
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.sub { color: var(--muted); max-width: 680px; margin: 0; }
.head-row { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 28px; }

.cards-3, .cards-4 { display: grid; gap: 16px; }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.card-top { display: flex; justify-content: space-between; align-items: center; }
.num { font-size: 32px; font-weight: 800; color: #c5c8d8; letter-spacing: -0.04em; }
html[data-theme="dark"] .num { color: #3a3e56; }
.badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--purple);
}
.card h3 { margin: 8px 0 8px; font-size: 26px; letter-spacing: -0.03em; line-height: 1.15; }
.card p, .card li { color: var(--muted); }
.card ul { padding: 0; margin: 16px 0; list-style: none; }
.card li { padding: 6px 0 6px 22px; position: relative; }
.card li::before { content: "✓"; position: absolute; left: 0; color: var(--purple); font-weight: 800; }
.rate { font-weight: 800; color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.filters button {
  border: 0;
  background: var(--chip);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}
.filters button.active { background: linear-gradient(180deg, #7d5cff, #6846f5); color: #fff; }
.filters em { font-style: normal; opacity: 0.75; margin-left: 6px; }

.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.work {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.work img { width: 100%; height: 240px; object-fit: cover; background: #eceef8; }
.work-body { padding: 18px 18px 20px; }
.work-body h3 { margin: 8px 0 4px; letter-spacing: -0.03em; }
.work-body p { margin: 0 0 12px; color: var(--muted); }
.work a.more { color: var(--purple); font-weight: 800; text-decoration: none; }

.layers { display: grid; gap: 12px; }
.layer {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.layer b { color: var(--purple); }
.layer p { margin: 4px 0 0; color: var(--muted); }
.layer span.tag { background: var(--soft); color: var(--purple); border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; }

.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.skill h3 { margin: 0 0 10px; font-size: 18px; }
.bar { height: 8px; background: var(--chip); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6a45ff, #4f7dff); border-radius: inherit; }
.skill small { color: var(--muted); }

.process { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
.steps { display: flex; flex-direction: column; gap: 8px; }
.steps button {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 700;
}
.steps button.active { background: var(--soft); color: var(--purple); border-color: transparent; }
.step-panel h3 { margin-top: 0; font-size: 28px; letter-spacing: -0.03em; }

.about-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 18px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fact { background: var(--chip); border-radius: 18px; padding: 16px; }
.fact strong { display: block; font-size: 18px; }
.fact span { color: var(--muted); font-size: 13px; }

.contact-title {
  max-width: 760px;
  margin: 8px 0 12px;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}
.contact-title span {
  display: block;
  background: linear-gradient(90deg, #6d4aff, #2563eb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.contact-lead { max-width: 640px; margin-bottom: 26px; }
.contact-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
  align-items: start;
}
.inquiry { padding: 22px; position: relative; }
.inquiry .btn { justify-self: start; }
.inquiry .btn:disabled { opacity: 0.65; }
.form-status { min-height: 1.4em; margin: 0; font-size: 14px; font-weight: 600; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--err); }
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
input:focus, textarea:focus {
  outline: 2px solid rgba(106, 69, 255, 0.45);
  border-color: transparent;
}
.reach { display: grid; grid-template-columns: 1fr; gap: 14px; }
.reach-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  text-decoration: none;
  min-height: 96px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
a.reach-card:hover, .reach-card:hover { transform: translateY(-2px); border-color: rgba(106, 69, 255, 0.45); }
.reach-card > a {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}
.reach-card i {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--soft);
  color: var(--purple);
  font-size: 18px;
  flex-shrink: 0;
}
.reach-card small {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.reach-card b { display: block; font-size: 16px; letter-spacing: -0.02em; }
.reach-card em { display: block; color: var(--muted); font-style: normal; font-size: 13px; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-weight: 700; font-size: 14px; }
input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 14px;
  padding: 12px 14px;
}
textarea { min-height: 120px; resize: vertical; }
.form-note { color: var(--muted); font-size: 13px; margin: 0; }
.copy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--chip);
  border-radius: 14px;
  padding: 12px 14px;
}
.copy-row a { font-weight: 700; text-decoration: none; word-break: break-all; }
.copy-btn {
  border: 0;
  background: var(--soft);
  color: var(--purple);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-row button {
  border: 1px solid var(--line);
  background: var(--chip);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
}
.choice-row button.active { background: var(--soft); color: var(--purple); border-color: transparent; }

.footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  position: relative;
  z-index: 1;
}
.footer-grid { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer a { color: var(--muted); text-decoration: none; margin-right: 14px; }
.footer p { color: var(--muted); margin: 8px 0 0; }

@media (max-width: 980px) {
  .header-actions .btn-primary { display: none; }
  .menu-btn { display: grid; place-items: center; }
  .nav-shell { display: none; }
  .nav-shell.open {
    display: block;
    position: absolute;
    left: 20px;
    right: 20px;
    top: 74px;
  }
  .nav { flex-direction: column; align-items: stretch; }
  .hero-grid, .cards-3, .cards-4, .work-grid, .skill-grid, .process, .about-grid, .contact-layout, .reach, .stats {
    grid-template-columns: 1fr;
  }
  .layer { grid-template-columns: 1fr; }
  .head-row { flex-direction: column; align-items: start; }
  .core-view { height: 280px; }
}
@media (max-width: 520px) {
  .brand-copy { display: none; }
  .wrap { width: min(1160px, calc(100% - 28px)); }
}
