/* ==========================================================
   bkhalid.dev — Basim Khalid
   ========================================================== */

:root {
  --bg: #07070d;
  --bg-2: #0d0d1a;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --text: #f1f2ff;
  --muted: #9ba0c4;

  --c1: #7c5cff; /* violet */
  --c2: #ff4ecd; /* pink   */
  --c3: #00d4ff; /* cyan   */
  --c4: #ffb547; /* amber  */
  --c5: #3dffa2; /* mint   */

  --grad: linear-gradient(110deg, var(--c1), var(--c2) 35%, var(--c4) 65%, var(--c3));
  --grad-loop: linear-gradient(90deg, var(--c1), var(--c2), var(--c4), var(--c3), var(--c1));
  --grad-soft: linear-gradient(135deg, rgba(124, 92, 255, .25), rgba(255, 78, 205, .18), rgba(0, 212, 255, .2));

  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --radius: 24px;
  --nav-h: 76px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--c2); color: #fff; }

/* subtle film grain */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.container { width: min(1200px, 100% - 48px); margin-inline: auto; }

.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.grad-text--anim { background-image: var(--grad-loop); background-size: 200% 100%; animation: gradShift 6s linear infinite; }
@keyframes gradShift { to { background-position: 200% 0; } }

/* ---------- Preloader ---------- */
.preloader { display: none; }
.js .preloader {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  background: var(--bg);
  transition: clip-path 1s var(--ease-out);
  clip-path: inset(0 0 0 0);
}
.preloader.done { clip-path: inset(0 0 100% 0); pointer-events: none; }
.preloader__logo { font-size: 3.5rem; font-weight: 700; letter-spacing: -.04em; animation: pulse 1.2s ease-in-out infinite; }
.preloader__logo span, .nav__logo span { color: var(--c2); }
.preloader__bar { width: 180px; height: 3px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.preloader__bar span { display: block; height: 100%; width: var(--p, 0%); background: var(--grad); transition: width .1s linear; }
.preloader__count { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
@keyframes pulse { 50% { opacity: .55; transform: scale(.96); } }

/* ---------- Scroll progress & cursor ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 1001;
  background: var(--grad);
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
}
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; z-index: 9999;
  pointer-events: none; border-radius: 50%;
  opacity: 0;
  transition: opacity .3s, width .3s var(--ease), height .3s var(--ease), background-color .3s, border-color .3s;
}
.has-cursor .cursor-dot, .has-cursor .cursor-ring { opacity: 1; }
.cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #fff; }
.cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 1.5px solid rgba(255, 255, 255, .5);
  mix-blend-mode: difference;
}
.cursor-ring.hover {
  width: 70px; height: 70px; margin: -35px 0 0 -35px;
  background: rgba(255, 255, 255, .95);
  border-color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 28px;
  border-radius: 999px;
  border: 0;
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.btn svg { transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--grad {
  color: #fff;
  background: var(--grad-loop);
  background-size: 200% 100%;
  box-shadow: 0 10px 30px -10px rgba(255, 78, 205, .6);
  animation: gradShift 8s linear infinite;
}
.btn--grad::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .45), transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s var(--ease);
}
.btn--grad:hover::after { transform: translateX(120%); }
.btn--grad:hover { box-shadow: 0 16px 40px -10px rgba(124, 92, 255, .8); }
.btn--ghost {
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.btn--small { padding: 10px 20px; font-size: .9rem; }
.btn--block { width: 100%; }
.magnetic { will-change: transform; }

/* ---------- Navigation ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: max(24px, (100% - 1200px) / 2);
  transition: transform .5s var(--ease), background-color .4s, backdrop-filter .4s, height .4s;
}
.nav.scrolled {
  height: 64px;
  background: rgba(7, 7, 13, .65);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 1px 0 var(--border);
}
.nav.hidden { transform: translateY(-100%); }
.nav__logo { font-size: 1.5rem; font-weight: 700; letter-spacing: -.04em; }
.nav__links { display: flex; align-items: center; gap: 34px; }
.nav__links a:not(.btn) {
  position: relative;
  font-size: .95rem;
  color: var(--muted);
  transition: color .3s;
}
.nav__links a:not(.btn) i {
  font-style: normal; font-family: var(--mono); font-size: .7rem;
  color: var(--c2); margin-right: 6px;
}
.nav__links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--grad); border-radius: 2px;
  transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease);
}
.nav__links a:not(.btn):hover, .nav__links a.active { color: var(--text); }
.nav__links a:not(.btn):hover::after, .nav__links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav__burger {
  display: none;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: var(--surface-2);
  cursor: pointer;
  position: relative; z-index: 2;
}
.nav__burger span {
  position: absolute; left: 13px; right: 13px; height: 2px; border-radius: 2px;
  background: var(--text); transition: transform .4s var(--ease), top .4s var(--ease);
}
.nav__burger span:nth-child(1) { top: 18px; }
.nav__burger span:nth-child(2) { top: 25px; }
.nav-open .nav__burger span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-open .nav__burger span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: calc(var(--nav-h) + 40px) 0 100px;
  overflow: hidden;
}
#particles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero__blobs { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; opacity: .55; }
.blob--1 {
  width: 60vmax; height: 60vmax; top: -25vmax; left: -15vmax;
  background: radial-gradient(circle, rgba(124, 92, 255, .55), transparent 62%);
  animation: blob1 18s ease-in-out infinite alternate;
}
.blob--2 {
  width: 50vmax; height: 50vmax; bottom: -25vmax; right: -12vmax;
  background: radial-gradient(circle, rgba(255, 78, 205, .45), transparent 62%);
  animation: blob2 22s ease-in-out infinite alternate;
}
.blob--3 {
  width: 36vmax; height: 36vmax; top: 30%; left: 45%;
  background: radial-gradient(circle, rgba(0, 212, 255, .32), transparent 62%);
  animation: blob3 16s ease-in-out infinite alternate;
}
@keyframes blob1 { to { transform: translate(12vw, 10vh) scale(1.15); } }
@keyframes blob2 { to { transform: translate(-14vw, -12vh) scale(1.2); } }
@keyframes blob3 { to { transform: translate(-20vw, 8vh) scale(.85); } }
.hero__grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 80%);
}
.hero__inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 40px;
}
.hero__badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  font-size: .85rem;
  color: var(--muted);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  backdrop-filter: blur(6px);
}
.pulse {
  position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--c5);
}
.pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--c5);
  animation: ping 1.8s var(--ease) infinite;
}
@keyframes ping { 80%, 100% { transform: scale(3); opacity: 0; } }

.hero__title { margin: 22px 0 14px; line-height: 1; letter-spacing: -.045em; }
.hero__hello {
  display: block;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--muted);
  margin-bottom: 14px;
}
.hero__name {
  display: block;
  font-size: clamp(3.2rem, 8.2vw, 7rem);
  font-weight: 700;
  animation: hueShift 10s ease-in-out infinite alternate;
}
@keyframes hueShift { from { filter: hue-rotate(-25deg); } to { filter: hue-rotate(35deg); } }
.hero__name .word { display: inline-block; white-space: nowrap; padding-bottom: .08em; overflow: hidden; vertical-align: top; }
.hero__name .char {
  display: inline-block;
  background: linear-gradient(90deg, var(--c1), var(--c2), var(--c4), var(--c3));
  background-size: 1200% 100%;
  background-position: var(--p, 0%) 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.js .hero__name .char {
  transform: translateY(110%) rotate(8deg);
  transition: transform 1s var(--ease-out);
  transition-delay: calc(300ms + var(--ci) * 45ms);
}
.loaded .hero__name .char { transform: none; }

.hero__role {
  font-size: clamp(1.25rem, 2.6vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -.02em;
}
.typed {
  background: linear-gradient(90deg, var(--c3), var(--c5));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.caret { color: var(--c3); font-weight: 400; margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hero__sub { max-width: 520px; margin-top: 18px; color: var(--muted); font-size: 1.08rem; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }

/* intro sequence */
.js .intro {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: calc(500ms + var(--i, 0) * 110ms);
}
.loaded .intro { opacity: 1; transform: none; }

/* hero visual */
.hero__visual { position: relative; height: 540px; perspective: 1200px; }
.layer { position: absolute; will-change: translate; }
.code-card {
  top: 40px; left: 0;
  width: min(390px, 92%);
  border-radius: 18px;
  background: rgba(16, 16, 32, .78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px var(--border), 0 30px 80px -20px rgba(0, 0, 0, .7), 0 0 60px -20px rgba(124, 92, 255, .45);
  overflow: hidden;
}
.code-card__bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot--r { background: #ff5f57; } .dot--y { background: #febc2e; } .dot--g { background: #28c840; }
.code-card__file { margin-left: 10px; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.code {
  padding: 18px 20px 22px;
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.75;
  color: #d7dbff;
  min-height: 268px;
}
.code .line { display: block; white-space: pre; overflow: hidden; height: 1.75em; }
.js .code .line { width: 0; }
.loaded .code .line {
  animation: typeLine calc(var(--n, 1) * 32ms) steps(var(--n, 1)) forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes typeLine { to { width: calc(var(--n, 1) * 1ch + 2px); } }
.code .k { color: var(--c2); }
.code .v { color: var(--c3); }
.code .p { color: #b9a6ff; }
.code .s { color: var(--c5); }
.code .n { color: var(--c4); }
.code .f { color: #ffd479; }
.code__caret {
  display: inline-block; width: 8px; height: 1.1em; margin-left: 2px;
  vertical-align: -3px; background: var(--c2);
  animation: blink 1s steps(1) infinite;
}

.phone {
  top: 140px; right: 4%;
  width: 210px; height: 420px;
  padding: 9px;
  border-radius: 40px;
  background: linear-gradient(145deg, #2a2a3d, #0e0e18);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .14), 0 40px 80px -20px rgba(0, 0, 0, .8), 0 0 70px -15px rgba(255, 78, 205, .55);
}
.phone__notch { position: absolute; top: 17px; left: 50%; width: 64px; height: 18px; margin-left: -32px; border-radius: 12px; background: #000; z-index: 2; }
.phone__screen {
  position: relative; height: 100%;
  border-radius: 32px;
  padding: 44px 14px 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #14142a, #0b0b16);
  display: flex; flex-direction: column; gap: 10px;
}
.phone__top { display: flex; justify-content: space-between; align-items: center; }
.phone__top small { display: block; font-size: .62rem; color: var(--muted); }
.phone__top strong { font-size: .95rem; }
.phone__avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); }
.phone__card {
  position: relative;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 12px 30px -10px rgba(255, 78, 205, .7);
}
.phone__card small { font-size: .62rem; opacity: .85; }
.phone__card strong { display: block; font-size: 1.35rem; letter-spacing: -.02em; }
.phone__card svg { width: 100%; height: 34px; margin-top: 4px; }
.spark { stroke-dasharray: 200; stroke-dashoffset: 200; }
.loaded .spark { animation: draw 2s 1.6s var(--ease-out) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.phone__row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px; border-radius: 14px; background: var(--surface-2);
}
.ico { width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0; }
.ico--1 { background: linear-gradient(135deg, var(--c3), var(--c1)); }
.ico--2 { background: linear-gradient(135deg, var(--c4), var(--c2)); }
.ico--3 { background: linear-gradient(135deg, var(--c5), var(--c3)); }
.bars { flex: 1; display: grid; gap: 5px; }
.bars i { display: block; height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .14); }
.bars i:first-child { width: 80%; background: rgba(255, 255, 255, .3); }
.bars i:last-child { width: 50%; }
.phone__row .bars i:first-child {
  background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,.45), rgba(255,255,255,.18));
  background-size: 200% 100%;
  animation: shimmer 2.2s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.phone__nav { margin-top: auto; display: flex; justify-content: space-around; padding: 10px; border-radius: 16px; background: var(--surface-2); }
.phone__nav i { width: 18px; height: 18px; border-radius: 6px; background: rgba(255, 255, 255, .15); }
.phone__nav i.on { background: var(--c2); box-shadow: 0 0 12px var(--c2); }

.chip {
  padding: 10px 16px;
  border-radius: 14px;
  font-size: .85rem; font-weight: 600;
  white-space: nowrap;
  background: rgba(20, 20, 38, .75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px var(--border), 0 15px 40px -15px rgba(0, 0, 0, .7);
}
.chip--1 { top: 0; right: 32%; }
.chip--2 { bottom: 40px; left: 6%; }
.chip--3 { top: 330px; left: -30px; }
.loaded .chip--1 { animation: float 6s 2.6s ease-in-out infinite; }
.loaded .chip--2 { animation: float 7s 2.8s ease-in-out infinite; }
.loaded .chip--3 { animation: float 5.5s 2.7s ease-in-out infinite; }
.loaded .phone { animation: float 8s 2s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-14px); } }

.hero__scroll {
  position: absolute; left: 50%; bottom: 28px; z-index: 2;
  transform: translateX(-50%);
  display: grid; justify-items: center; gap: 8px;
  color: var(--muted);
  font-family: var(--mono); font-size: .7rem; letter-spacing: .2em; text-transform: uppercase;
}
.mouse { width: 24px; height: 38px; border-radius: 14px; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35); display: flex; justify-content: center; padding-top: 7px; }
.mouse span { width: 3px; height: 8px; border-radius: 3px; background: var(--c2); animation: wheel 1.8s var(--ease) infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- Marquee ---------- */
.marquee { position: relative; padding: 50px 0; overflow: hidden; }
.marquee__row { display: flex; width: 110%; margin-left: -5%; overflow: hidden; }
.marquee__row--a {
  background: var(--grad);
  color: #0a0a12;
  transform: rotate(-2deg) scale(1.05);
  position: relative; z-index: 2;
  box-shadow: 0 20px 60px -20px rgba(255, 78, 205, .5);
}
.marquee__row--b {
  background: #101020;
  transform: rotate(2deg) scale(1.05);
  margin-top: -6px;
}
.marquee__track {
  display: flex; align-items: center; gap: 30px;
  padding: 18px 15px;
  flex-shrink: 0;
  animation: marquee 32s linear infinite;
}
.marquee__row--b .marquee__track { animation-direction: reverse; animation-duration: 38s; }
.marquee__track span { font-size: clamp(1.4rem, 3vw, 2.3rem); font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.marquee__row--b span { color: transparent; -webkit-text-stroke: 1.2px rgba(255, 255, 255, .55); }
.marquee__track b { font-size: 1.1rem; }
.marquee__row--b b { color: var(--c2); }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- Sections ---------- */
.section { position: relative; padding: 130px 0; overflow-x: clip; }
.section__head { margin-bottom: 64px; }
.section__head--center { text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: .8rem; letter-spacing: .15em; text-transform: uppercase;
  color: var(--muted);
}
.eyebrow span {
  padding: 4px 10px; border-radius: 8px;
  background: var(--grad-soft);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--text);
}
.eyebrow::after { content: ""; width: 60px; height: 1px; background: linear-gradient(90deg, var(--c2), transparent); }
.section__head--center .eyebrow::after { display: none; }
.section__title {
  margin-top: 16px;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.02;
  letter-spacing: -.045em;
  font-weight: 700;
}

/* reveal on scroll */
.js [data-reveal] {
  opacity: 0;
  translate: 0 46px;
  transition: opacity 1s var(--ease-out) var(--d, 0ms), translate 1s var(--ease-out) var(--d, 0ms);
}
.js [data-reveal][data-tilt] {
  transition: opacity 1s var(--ease-out) var(--d, 0ms), translate 1s var(--ease-out) var(--d, 0ms), transform .25s ease-out;
}
.js [data-reveal].in { opacity: 1; translate: 0 0; }

/* ---------- About ---------- */
.about__grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 80px; align-items: center; }
.about__avatar { position: relative; display: grid; place-items: center; transform-style: preserve-3d; }
.avatar { position: relative; width: min(360px, 80vw); aspect-ratio: 1; display: grid; place-items: center; }
.avatar__ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--c1), var(--c2), var(--c4), var(--c5), var(--c3), var(--c1));
  animation: spin 8s linear infinite;
  filter: blur(.5px);
}
.avatar__ring::after {
  content: ""; position: absolute; inset: -30px; border-radius: 50%;
  background: inherit; filter: blur(50px); opacity: .5; z-index: -1;
}
@keyframes spin { to { transform: rotate(360deg); } }
.avatar__inner {
  position: relative;
  width: calc(100% - 14px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #1d1d38, #08080f 70%);
  display: grid; place-items: center;
  overflow: hidden;
}
.avatar__inner::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: radial-gradient(circle, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 75%);
}
.avatar__inner span {
  position: relative;
  font-size: clamp(5rem, 13vw, 9rem); font-weight: 700; letter-spacing: -.06em;
  background: var(--grad-loop); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradShift 6s linear infinite;
  transform: translateZ(40px);
}
.avatar__tag {
  position: absolute;
  padding: 8px 16px; border-radius: 999px;
  font-size: .85rem; font-weight: 600;
  background: rgba(16, 16, 32, .85);
  backdrop-filter: blur(8px);
  box-shadow: inset 0 0 0 1px var(--border), 0 10px 30px -10px rgba(0, 0, 0, .7);
  animation: float 6s ease-in-out infinite;
}
.avatar__tag--1 { top: 8%; left: 0; color: var(--c3); }
.avatar__tag--2 { top: 45%; right: -4%; color: var(--c2); animation-delay: -2s; }
.avatar__tag--3 { bottom: 6%; left: 12%; color: var(--c4); animation-delay: -4s; }

.about__text p { color: var(--muted); font-size: 1.08rem; margin-bottom: 20px; }
.about__text .lead { color: var(--text); font-size: clamp(1.35rem, 2.4vw, 1.75rem); line-height: 1.4; letter-spacing: -.02em; }
.hl { font-style: normal; font-weight: 600; position: relative; white-space: nowrap; }
.hl::after {
  content: ""; position: absolute; left: -2px; right: -2px; bottom: 2px; height: 35%; z-index: -1;
  border-radius: 4px; opacity: .35;
  transform: scaleX(0); transform-origin: left;
  transition: transform .8s var(--ease-out) .6s;
}
.in .hl::after { transform: scaleX(1); }
.hl--pink { color: var(--c2); } .hl--pink::after { background: var(--c2); }
.hl--cyan { color: var(--c3); } .hl--cyan::after { background: var(--c3); }
.hl--amber { color: var(--c4); } .hl--amber::after { background: var(--c4); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 36px; }
.stat {
  padding: 20px 16px; border-radius: 18px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: transform .4s var(--ease), box-shadow .4s;
}
.stat:hover { transform: translateY(-6px); box-shadow: inset 0 0 0 1px rgba(255, 78, 205, .45), 0 20px 40px -20px rgba(255, 78, 205, .5); }
.stat strong {
  display: block; font-size: clamp(1.8rem, 3vw, 2.4rem); line-height: 1.1; letter-spacing: -.04em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat small { display: block; margin-top: 6px; font-size: .8rem; color: var(--muted); line-height: 1.3; }

.toolbox { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 100px; }
.tool-group {
  padding: 26px; border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}
.tool-group h3 { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin-bottom: 18px; }
.tg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 14px var(--c); }
.tool-group ul { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-group li {
  padding: 6px 12px; border-radius: 10px;
  font-size: .82rem; color: var(--muted);
  background: var(--surface-2);
  transition: color .25s, background-color .25s, transform .25s var(--ease);
}
.tool-group li:hover { color: #fff; background: rgba(124, 92, 255, .35); transform: translateY(-3px); }

/* ---------- Services ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card {
  --mx: 50%; --my: 50%;
  position: relative;
  padding: 34px 28px 30px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .025);
  overflow: hidden;
  isolation: isolate;
  transition: transform .5s var(--ease);
}
.card::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; padding: 1px; z-index: -1;
  background: radial-gradient(300px circle at var(--mx) var(--my), var(--accent), transparent 60%), var(--border);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.card::after {
  content: "";
  position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(400px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%);
  opacity: 0; transition: opacity .4s;
}
.card:hover { transform: translateY(-8px); }
.card:hover::after { opacity: 1; }
.card__icon {
  width: 58px; height: 58px; border-radius: 18px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
  margin-bottom: 26px;
  transition: transform .5s var(--ease);
}
.card:hover .card__icon { transform: rotate(-8deg) scale(1.08); }
.card__icon svg { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { font-size: 1.3rem; letter-spacing: -.02em; margin-bottom: 10px; }
.card p { font-size: .95rem; color: var(--muted); }
.card__num {
  position: absolute; top: 22px; right: 24px;
  font-family: var(--mono); font-size: .8rem; color: rgba(255, 255, 255, .25);
}

/* ---------- Feedback ---------- */
.feedback__sub { margin-top: 18px; max-width: 560px; color: var(--muted); font-size: 1.1rem; }
.feedback__form { max-width: 760px; }
.feedback fieldset { border: 0; min-width: 0; }
.feedback legend { margin-bottom: 12px; font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.feedback legend small { font-size: inherit; text-transform: none; letter-spacing: 0; opacity: .7; }
.apps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.app {
  position: relative; cursor: pointer;
  display: flex; align-items: center; gap: 16px;
  padding: 18px; border-radius: 20px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: box-shadow .3s, background-color .3s, transform .4s var(--ease);
}
.app:hover { transform: translateY(-3px); }
.app input { position: absolute; opacity: 0; pointer-events: none; }
.app:has(input:checked) { background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: inset 0 0 0 1.5px var(--accent), 0 14px 34px -16px var(--accent); }
.app:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.app__icon {
  flex-shrink: 0;
  width: 54px; height: 54px; border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border), 0 8px 20px -10px rgba(0, 0, 0, .7);
}
.app__name strong { display: block; font-size: 1.2rem; letter-spacing: -.02em; }
.app__name small { display: block; font-size: .82rem; color: var(--muted); }
.apps.error .app { box-shadow: inset 0 0 0 1.5px #ff5f7a; }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 6px; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label { cursor: pointer; font-size: 2rem; line-height: 1; color: rgba(255, 255, 255, .16); transition: color .2s, transform .3s var(--ease); }
.stars label::before { content: "★"; }
.stars label:hover { transform: scale(1.15); }
.stars input:checked ~ label, .stars label:hover, .stars label:hover ~ label { color: var(--c4); }
.stars input:focus-visible + label { outline: 2px solid var(--c4); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.feedback__row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* ---------- Process / timeline ---------- */
.timeline { position: relative; display: grid; gap: 40px; max-width: 980px; margin-inline: auto; }
.timeline::before, .timeline::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; border-radius: 2px;
}
.timeline::before { background: var(--border); }
.timeline::after {
  background: linear-gradient(var(--c1), var(--c2), var(--c3), var(--c4));
  transform-origin: top;
  transform: scaleY(var(--progress, 0));
  box-shadow: 0 0 20px rgba(255, 78, 205, .6);
}
.step { position: relative; display: grid; grid-template-columns: 1fr 1fr; }
.step__body {
  grid-column: 1;
  margin-right: 60px;
  padding: 28px 30px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  text-align: right;
  transition: box-shadow .4s, transform .4s var(--ease);
}
.step:nth-child(even) .step__body { grid-column: 2; margin: 0 0 0 60px; text-align: left; }
.step__body:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent), 0 20px 50px -25px var(--accent); }
.step small { font-family: var(--mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.step h3 { font-size: 1.6rem; letter-spacing: -.03em; margin: 4px 0 8px; }
.step p { color: var(--muted); }
.step__dot {
  position: absolute; left: 50%; top: 34px; z-index: 1;
  width: 20px; height: 20px; margin-left: -10px; border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 3px var(--accent);
  transition: box-shadow .5s, background-color .5s;
}
.step.in .step__dot { background: var(--accent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 24px var(--accent); }

/* ---------- Contact ---------- */
.contact { overflow: hidden; }
.contact__glow {
  position: absolute; left: 50%; top: 10%; width: 900px; height: 600px; margin-left: -450px; z-index: -1;
  background: radial-gradient(closest-side, rgba(124, 92, 255, .35), rgba(255, 78, 205, .15) 50%, transparent);
  animation: breathe 8s ease-in-out infinite alternate;
}
@keyframes breathe { to { transform: scale(1.2); opacity: .7; } }
.contact__title { margin-top: 18px; font-size: clamp(2.4rem, 7vw, 5.6rem); line-height: 1.02; letter-spacing: -.05em; }
.contact__sub { margin: 22px auto 0; max-width: 520px; color: var(--muted); font-size: 1.1rem; }
.contact__grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 28px; max-width: 1000px; margin-inline: auto; }
.contact__form {
  padding: 36px; border-radius: 28px;
  background: rgba(16, 16, 32, .6);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px var(--border);
  display: grid; gap: 20px;
}
.field { position: relative; }
.field input, .field textarea {
  width: 100%;
  padding: 24px 18px 10px;
  border: 0; border-radius: 14px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  outline: none; resize: vertical;
  transition: box-shadow .3s, background-color .3s;
}
.field textarea { min-height: 130px; }
.field input:focus, .field textarea:focus { background: rgba(124, 92, 255, .08); box-shadow: inset 0 0 0 1.5px var(--c1), 0 0 0 4px rgba(124, 92, 255, .18); }
.field label {
  position: absolute; left: 18px; top: 17px;
  color: var(--muted); pointer-events: none;
  transform-origin: left top;
  transition: transform .3s var(--ease), color .3s;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  transform: translateY(-10px) scale(.75); color: var(--c2);
}
.field.error input, .field.error textarea { box-shadow: inset 0 0 0 1.5px #ff5f7a; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.captcha { min-height: 78px; display: flex; align-items: center; }
.captcha.error iframe { outline: 1.5px solid #ff5f7a; outline-offset: 2px; border-radius: 6px; }
.captcha__loading { font-size: .85rem; color: var(--muted); }
.btn.loading { pointer-events: none; opacity: .85; }
.btn.loading svg { display: none; }
.btn.loading::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.form__note { min-height: 1.4em; font-size: .9rem; text-align: center; color: var(--c5); }
.form__note.err { color: #ff7a90; }

.contact__side { display: flex; flex-direction: column; gap: 24px; }
.contact__wa {
  position: relative;
  display: flex; align-items: center; gap: 18px;
  padding: 26px 64px 26px 26px; border-radius: 28px;
  color: #fff;
  background: linear-gradient(90deg, #25d366, #128c7e, #00d4ff, #25d366);
  background-size: 200% 100%;
  animation: gradShift 10s linear infinite;
  box-shadow: 0 18px 45px -18px rgba(37, 211, 102, .7);
  overflow: hidden;
  isolation: isolate;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.contact__wa::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .35), transparent 70%);
  transform: translateX(-120%);
  transition: transform .8s var(--ease);
}
.contact__wa::after {
  content: "↗"; position: absolute; right: 24px; top: 18px; font-size: 1.8rem;
  transition: transform .4s var(--ease);
}
.contact__wa:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 26px 55px -18px rgba(37, 211, 102, .9); }
.contact__wa:hover::before { transform: translateX(120%); }
.contact__wa:hover::after { transform: translate(4px, -4px); }
.contact__wa-icon {
  position: relative;
  flex-shrink: 0;
  width: 58px; height: 58px; border-radius: 18px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}
.contact__wa-icon::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, .55);
  animation: waRing 2.4s var(--ease) infinite;
}
@keyframes waRing { 70%, 100% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); } }
.contact__wa-icon svg { width: 30px; height: 30px; transition: transform .5s var(--ease); }
.contact__wa:hover .contact__wa-icon svg { transform: rotate(-12deg) scale(1.1); }
.contact__wa small { display: block; font-size: .85rem; opacity: .9; }
.contact__wa strong { display: block; font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.2; letter-spacing: -.02em; }
.socials { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.social {
  aspect-ratio: 1; border-radius: 20px;
  display: grid; place-items: center;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: background-color .3s, box-shadow .3s, color .3s;
}
.social svg { width: 24px; height: 24px; transition: transform .4s var(--ease); }
.social:hover { background: rgba(255, 78, 205, .14); box-shadow: inset 0 0 0 1px rgba(255, 78, 205, .6), 0 10px 30px -10px var(--c2); color: #fff; }
.social:hover svg { transform: scale(1.15) rotate(-6deg); }
.contact__loc {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 22px; border-radius: 20px;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--border);
  color: var(--muted);
}
.contact__loc svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: var(--c3); stroke-width: 2; }

/* ---------- Footer ---------- */
.footer { padding: 36px 0; border-top: 1px solid var(--border); }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer p { color: var(--muted); font-size: .9rem; text-align: center; }
.to-top {
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border);
  transition: background-color .3s;
}
.to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.to-top:hover { background: var(--c1); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .toolbox { grid-template-columns: repeat(2, 1fr); }
  .about__grid { gap: 50px; }
}

@media (max-width: 900px) {
  :root { --nav-h: 68px; }
  .nav__burger { display: block; }
  .nav__links {
    position: fixed; inset: 0;
    flex-direction: column; justify-content: center; gap: 26px;
    background: rgba(7, 7, 13, .96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    clip-path: circle(0 at calc(100% - 46px) 34px);
    transition: clip-path .7s var(--ease-out);
  }
  .nav-open .nav__links { clip-path: circle(150% at calc(100% - 46px) 34px); }
  .nav__links a:not(.btn) { font-size: 2rem; font-weight: 600; color: var(--text); opacity: 0; transform: translateY(20px); transition: opacity .5s, transform .5s var(--ease-out), color .3s; }
  .nav__links .btn { opacity: 0; transform: translateY(20px); transition: opacity .5s .35s, transform .5s .35s var(--ease-out); }
  .nav-open .nav__links a { opacity: 1 !important; transform: none !important; }
  .nav-open .nav__links a:nth-child(1) { transition-delay: .15s; }
  .nav-open .nav__links a:nth-child(2) { transition-delay: .2s; }
  .nav-open .nav__links a:nth-child(3) { transition-delay: .25s; }
  .nav-open .nav__links a:nth-child(4) { transition-delay: .3s; }
  .nav-open { overflow: hidden; }

  .hero { padding-bottom: 120px; }
  .hero__inner { grid-template-columns: 1fr; gap: 50px; }
  .hero__visual { height: 450px; width: min(480px, 100%); margin-inline: auto; }
  .code-card { width: min(340px, 86%); top: 30px; }
  .code { font-size: 12.5px; min-height: 240px; }
  .phone { width: 170px; height: 340px; top: 110px; right: 0; border-radius: 34px; }
  .phone__screen { border-radius: 27px; padding-top: 38px; gap: 8px; }
  .phone__notch { top: 15px; width: 54px; height: 15px; margin-left: -27px; }
  .chip--1 { right: 22%; }
  .chip--3 { top: 300px; left: 0; }
  .chip--2 { bottom: 10px; left: 18%; }
  .hero__scroll { display: none; }

  .section { padding: 100px 0; }
  .section__head { margin-bottom: 48px; }
  .about__grid { grid-template-columns: 1fr; }
  .avatar { width: min(300px, 74vw); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .toolbox { margin-top: 70px; }

  .timeline::before, .timeline::after { left: 10px; }
  .step { grid-template-columns: 1fr; }
  .step__body, .step:nth-child(even) .step__body { grid-column: 1; margin: 0 0 0 46px; text-align: left; }
  .step__dot { left: 10px; }

  .contact__grid { grid-template-columns: 1fr; }
  .footer__inner { flex-direction: column; text-align: center; }
}

@media (max-width: 560px) {
  .container { width: calc(100% - 32px); }
  .nav { padding-inline: 16px; }
  .hero__cta .btn { flex: 1 1 auto; }
  .hero__visual { height: 400px; }
  .code-card { width: 88%; }
  .code { font-size: 11px; padding: 14px 14px 18px; min-height: 210px; }
  .phone { width: 145px; height: 290px; top: 120px; padding: 7px; border-radius: 30px; }
  .phone__screen { border-radius: 24px; padding: 34px 10px 10px; gap: 7px; }
  .phone__card { padding: 10px; border-radius: 14px; }
  .phone__card strong { font-size: 1.05rem; }
  .phone__row { padding: 7px; }
  .ico { width: 22px; height: 22px; }
  .phone__row:nth-of-type(5) { display: none; }
  .chip { font-size: .75rem; padding: 8px 12px; }
  .chip--3 { top: 270px; }
  .cards, .toolbox, .apps, .feedback__row { grid-template-columns: 1fr; }
  .contact__form { padding: 24px; }
  .avatar__tag--2 { right: 0; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .code .line { width: auto !important; }
}
