/* =========================================================
   SoftApps — futuristic dark theme
   ========================================================= */

:root {
  --bg: #05070f;
  --bg-2: #0a0e1a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f7ff;
  --text-dim: #9aa4bf;
  --text-faint: #626b86;

  --cyan: #22d3ee;
  --violet: #7c3aed;
  --magenta: #ec4899;
  --grad: linear-gradient(110deg, var(--cyan), var(--violet) 55%, var(--magenta));
  --grad-soft: linear-gradient(110deg, rgba(34, 211, 238, 0.18), rgba(124, 58, 237, 0.18), rgba(236, 72, 153, 0.18));

  --maxw: 1180px;
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 30px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: "Space Grotesk", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

/* ---------- background mesh ---------- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(50% 55% at 12% 8%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(45% 50% at 88% 20%, rgba(236, 72, 153, 0.15), transparent 60%),
    radial-gradient(55% 60% at 60% 100%, rgba(124, 58, 237, 0.20), transparent 60%),
    var(--bg);
  animation: meshDrift 24s ease-in-out infinite alternate;
}
@keyframes meshDrift {
  from { transform: translate3d(-2%, -1%, 0) scale(1.05); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.12); }
}
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 78%);
}
.bg-noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ---------- custom cursor ---------- */
.cursor-glow {
  position: fixed;
  top: 0; left: 0;
  width: 380px; height: 380px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(124, 58, 237, 0.18), transparent 62%);
  transition: opacity 0.4s;
  will-change: transform;
}

/* ---------- layout ---------- */
.wrap { width: min(var(--maxw), 92vw); margin-inline: auto; }
section { position: relative; padding: clamp(80px, 12vw, 160px) 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  backdrop-filter: blur(8px);
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 12px var(--violet);
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-head h2 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 20px 0 16px; }
.section-head p { color: var(--text-dim); font-size: 1.1rem; margin: 0; }

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(20px, 4vw, 48px);
  transition: background 0.4s, backdrop-filter 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(5, 7, 15, 0.72);
  backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand svg { height: 34px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { color: var(--text-dim); font-size: 0.95rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.header-right { display: flex; align-items: center; gap: 16px; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 3px;
  background: var(--surface);
}
.lang-switch button {
  border: 0; background: transparent; color: var(--text-dim);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.03em;
  padding: 5px 12px; border-radius: 100px; transition: color 0.2s, background 0.3s;
}
.lang-switch button.is-active { color: #fff; background: var(--grad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
  padding: 13px 24px; border-radius: 100px; border: 1px solid var(--border-strong);
  color: var(--text); background: var(--surface-2);
  transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface); }
.btn-primary { border: 0; color: #fff; background: var(--grad); box-shadow: 0 10px 40px -12px rgba(124, 58, 237, 0.7); }
.btn-primary:hover { box-shadow: 0 16px 50px -12px rgba(124, 58, 237, 0.9); }
.btn-sm { padding: 10px 18px; font-size: 0.88rem; }

.menu-toggle { display: none; background: none; border: 0; color: var(--text); }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 120px;
  overflow: hidden;
}
#hero-canvas {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 6rem);
  max-width: 15ch;
  margin: 26px 0 24px;
}
.hero-sub { font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--text-dim); max-width: 54ch; margin: 0 0 38px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-scroll {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-faint); font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
}
.hero-scroll .line { width: 1px; height: 42px; background: linear-gradient(var(--violet), transparent); animation: scrollLine 2s ease-in-out infinite; }
@keyframes scrollLine { 0%,100% { opacity: 0.3; transform: scaleY(0.6); } 50% { opacity: 1; transform: scaleY(1); } }

/* reveal words (hero title split) */
.reveal-line { overflow: hidden; }

/* ---------- marquee ---------- */
.marquee {
  border-block: 1px solid var(--border);
  background: var(--bg-2);
  padding: 20px 0;
  overflow: hidden;
  white-space: nowrap;
}
.marquee-track {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.4vw, 1.8rem);
  font-weight: 600;
  color: var(--text-faint);
  animation: marquee 26s linear infinite;
}
.marquee-track span { padding-inline: 6px; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- about / stats ---------- */
.about-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(40px, 6vw, 80px); align-items: center; }
.about-copy p { color: var(--text-dim); font-size: 1.1rem; }
.about-copy p + p { margin-top: 18px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 26px 22px;
  background: var(--surface);
  backdrop-filter: blur(8px);
  transition: transform 0.4s var(--ease), border-color 0.3s;
}
.stat:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.stat .n { font-family: var(--font-display); font-size: 2rem; font-weight: 700; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .l { color: var(--text-dim); font-size: 0.95rem; margin-top: 4px; }

/* ---------- work / portfolio ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 30px;
  background: linear-gradient(160deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  overflow: hidden;
  transform-style: preserve-3d;
  transition: border-color 0.3s, box-shadow 0.4s;
  min-height: 340px;
}
.card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), rgba(124,58,237,0.18), transparent 45%);
  opacity: 0; transition: opacity 0.4s;
}
.card:hover { border-color: var(--border-strong); box-shadow: 0 30px 70px -30px rgba(0,0,0,0.8); }
.card:hover::before { opacity: 1; }
.card-inner { transform: translateZ(40px); display: flex; flex-direction: column; height: 100%; }
.card-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.card-icon { width: 60px; height: 60px; border-radius: 16px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; background: #0a0e1a; }
.card-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tag {
  font-family: var(--font-display); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 100px; border: 1px solid var(--border);
  color: var(--text-dim);
}
.tag-own { color: #fff; background: var(--grad-soft); border-color: transparent; }
.tag-live { color: #6ee7b7; border-color: rgba(110,231,183,0.35); }
.tag-soon { color: #fcd34d; border-color: rgba(252,211,77,0.35); }
.card h3 { font-size: 1.5rem; margin-bottom: 10px; }
.card p { color: var(--text-dim); font-size: 1rem; margin: 0 0 22px; }
.card-cta { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; color: var(--text); font-size: 0.95rem; }
.card-cta .arrow { transition: transform 0.3s var(--ease); }
.card:hover .card-cta .arrow { transform: translateX(6px); }
.card-thumb { position: absolute; right: -40px; bottom: -40px; width: 200px; opacity: 0.14; filter: blur(0.3px); transform: rotate(-8deg); pointer-events: none; }

/* ---------- services ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.svc {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 30px 26px;
  background: var(--surface);
  transition: transform 0.4s var(--ease), border-color 0.3s, background 0.3s;
}
.svc:hover { transform: translateY(-6px); border-color: var(--border-strong); background: var(--surface-2); }
.svc-ico {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; margin-bottom: 20px;
  background: var(--grad-soft); border: 1px solid var(--border);
  font-size: 26px;
}
.svc h3 { font-size: 1.2rem; margin-bottom: 10px; }
.svc p { color: var(--text-dim); font-size: 0.96rem; margin: 0; }

/* ---------- contact ---------- */
.contact-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: clamp(44px, 7vw, 90px);
  text-align: center;
  background: var(--surface);
  overflow: hidden;
}
.contact-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(60% 80% at 50% 0%, rgba(124,58,237,0.22), transparent 70%);
}
.contact-card h2 { font-size: clamp(2rem, 5vw, 3.4rem); margin-bottom: 18px; }
.contact-card p { color: var(--text-dim); font-size: 1.15rem; margin: 0 auto 34px; max-width: 46ch; }
.mail-btn { font-size: 1.05rem; padding: 16px 32px; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 50px 0 40px;
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer-inner .brand svg { height: 30px; }
.footer-meta { color: var(--text-faint); font-size: 0.9rem; text-align: right; display: flex; flex-direction: column; gap: 5px; }
.footer-meta a { color: var(--text-dim); }
.footer-meta a:hover { color: var(--text); }
.footer-legal { font-size: 0.8rem; color: var(--text-faint); margin-top: 4px; }

/* ---------- reveal animation (JS-driven + fallback) ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .menu-toggle { display: block; }
  .about-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .svc-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .svc-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .footer-meta { text-align: left; }
  .card { min-height: 300px; padding: 26px; }
}

/* ---------- mobile menu ---------- */
.mobile-menu {
  position: fixed; inset: 0; z-index: 49;
  background: rgba(5,7,15,0.96);
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  opacity: 0; pointer-events: none; transition: opacity 0.35s;
}
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu a { font-family: var(--font-display); font-size: 1.6rem; color: var(--text); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .bg-mesh { animation: none; }
  .reveal { opacity: 1; transform: none; }
  .cursor-glow { display: none; }
  .marquee-track { animation: none; }
}
