
/* ===== Midnight Atelier — NightByte Labs ===== */

:root { color-scheme: dark; }
* { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html { scroll-behavior: smooth; }
body {
  background: #06050d;
  color: #e2e8f0;
  font-feature-settings: "ss01", "cv11", "kern";
  position: relative;
  overflow-x: hidden;
  min-height: 100vh;
}
::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

/* Typography utilities */
.font-serif { font-family: "Fraunces", Georgia, serif; font-optical-sizing: auto; font-variation-settings: "SOFT" 30, "opsz" 144; }
.font-serif-italic { font-family: "Fraunces", Georgia, serif; font-style: italic; font-variation-settings: "SOFT" 50, "opsz" 144; }
.font-mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

.text-gradient {
  background: linear-gradient(135deg, #c4b5fd 0%, #f0abfc 45%, #fcd34d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Grain overlay (site-wide) */
.grain {
  pointer-events: none;
  position: fixed; inset: 0;
  z-index: 50;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  mix-blend-mode: overlay;
}

/* Cursor follow spotlight (hero + pointer-fine only) */
.cursor-glow {
  pointer-events: none;
  position: fixed; top: 0; left: 0;
  width: 480px; height: 480px;
  z-index: 1;
  background: radial-gradient(circle at center, rgba(139,92,246,0.18), rgba(236,72,153,0.05) 35%, transparent 60%);
  transform: translate3d(-600px, -600px, 0);
  transition: transform 0.08s linear, opacity 0.5s;
  will-change: transform;
  opacity: 0;
}
body { --cg-opacity: 0; }
html:hover .cursor-glow { opacity: 1; }
@media (pointer: coarse) { .cursor-glow { display: none; } }

/* Nav scroll state */
#nav {
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
}
#nav.nav-scrolled {
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  background: rgba(6, 5, 13, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#nav.nav-scrolled > div {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

/* Scroll reveals */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal="fade"] { transform: none; }
[data-reveal="scale"] { transform: scale(0.96); }
[data-reveal="scale"].is-visible { transform: scale(1); }

/* Hero mesh gradient */
.mesh {
  position: absolute; inset: -20%;
  background:
    radial-gradient(60% 50% at 20% 15%, rgba(139, 92, 246, 0.38), transparent 60%),
    radial-gradient(50% 40% at 85% 20%, rgba(236, 72, 153, 0.22), transparent 65%),
    radial-gradient(55% 45% at 50% 95%, rgba(245, 158, 11, 0.12), transparent 65%),
    radial-gradient(70% 60% at 80% 75%, rgba(99, 102, 241, 0.28), transparent 60%);
  filter: blur(14px);
  animation: drift 28s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-1.5%, 1%, 0) scale(1.05); }
  100% { transform: translate3d(1%, -1%, 0) scale(1.02); }
}

.bg-dots {
  background-image: radial-gradient(rgba(139, 92, 246, 0.13) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Eyebrow label */
.eyebrow {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(196, 181, 253, 0.75);
  display: inline-block;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  background: currentColor;
  vertical-align: middle;
  margin-right: 12px;
  opacity: 0.55;
}

/* Card hover lift + conic glow border */
.lift { transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.4s, background 0.4s; }
.lift:hover { transform: translateY(-3px); background: rgba(255,255,255,0.025); }

.glow-card { position: relative; isolation: isolate; }
.glow-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 70%, rgba(139,92,246,0.75) 85%, rgba(236,72,153,0.75) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin-angle { to { --angle: 360deg; } }
.glow-card:hover::before {
  opacity: 1;
  animation: spin-angle 5s linear infinite;
}

/* Service icon tile */
.svc-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(236, 72, 153, 0.06));
  border: 1px solid rgba(139, 92, 246, 0.22);
  color: #c4b5fd;
  margin-bottom: 1.25rem;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.5s, border-color 0.5s;
}
.glow-card:hover .svc-icon {
  transform: scale(1.08) rotate(-3deg);
  color: #f0abfc;
  border-color: rgba(236, 72, 153, 0.4);
}

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.95rem 1.7rem;
  background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 50%, #d946ef 100%);
  color: #fff;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.93rem;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 40px -12px rgba(139, 92, 246, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.25s;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-primary::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #a855f7, #d946ef 50%, #f59e0b);
  opacity: 0;
  transition: opacity 0.35s;
  z-index: -1;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 48px -12px rgba(139, 92, 246, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover::before { opacity: 1; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.95rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.93rem;
  transition: border-color 0.3s, background 0.3s, transform 0.25s;
}
.btn-ghost:hover {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

/* Marquee */
.marquee {
  --gap: 4rem;
  display: flex;
  gap: var(--gap);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 8%, black 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: var(--gap);
  flex-shrink: 0;
  align-items: center;
  animation: marquee 44s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee {
  to { transform: translateX(calc(-100% - var(--gap))); }
}

/* Process step number */
.step-num {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-size: 3.25rem;
  font-weight: 500;
  font-variation-settings: "SOFT" 60, "opsz" 144;
  background: linear-gradient(180deg, #c4b5fd, rgba(196, 181, 253, 0.2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  line-height: 1;
  letter-spacing: -0.02em;
}

/* Focus-visible */
a:focus-visible, button:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 3px;
  border-radius: 6px;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #06050d; }
::-webkit-scrollbar-thumb { background: #1a1530; border-radius: 10px; border: 2px solid #06050d; }
::-webkit-scrollbar-thumb:hover { background: #2d1f4e; }

/* Mobile nav item spacing */
#mobileMenu a { border-bottom: 1px solid rgba(255,255,255,0.04); }
#mobileMenu a:last-child { border-bottom: 0; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .mesh { animation: none; }
  [data-reveal] { opacity: 1; transform: none; }
}
