/* ============ Base ============ */
:root {
  --bg: #07070f;
  --bg-soft: #0d0d1a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.09);
  --text: #f2f2f8;
  --text-dim: #9a9ab0;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --accent-3: #ff4ecd;
  --gradient: linear-gradient(120deg, var(--accent), var(--accent-2));
  --radius: 18px;
  --font-display: 'Sora', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #fff; }

/* ============ Preloader ============ */
.preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  transition: opacity 0.6s ease, visibility 0.6s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.preloader-logo {
  font-family: var(--font-display); font-weight: 800; font-size: 2rem; letter-spacing: -0.02em;
  animation: pulse-logo 1.2s ease infinite alternate;
}
.preloader-logo span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.preloader-bar { width: 180px; height: 3px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; }
.preloader-bar-fill { height: 100%; width: 0%; background: var(--gradient); border-radius: 99px; animation: load-bar 1s ease forwards; }
@keyframes load-bar { to { width: 100%; } }
@keyframes pulse-logo { from { opacity: 0.6; } to { opacity: 1; } }

/* ============ Page transition overlay ============ */
.transition-overlay {
  position: fixed; inset: 0; z-index: 900;
  display: flex; pointer-events: none;
}
.t-col {
  flex: 1; background: linear-gradient(180deg, #12121f, #0a0a14);
  transform: scaleY(0); transform-origin: top;
}
.transition-overlay.in .t-col { animation: col-in 0.5s cubic-bezier(0.76, 0, 0.24, 1) forwards; }
.transition-overlay.out .t-col { transform: scaleY(1); transform-origin: bottom; animation: col-out 0.5s cubic-bezier(0.76, 0, 0.24, 1) forwards; }
.t-col:nth-child(1) { animation-delay: 0ms !important; }
.t-col:nth-child(2) { animation-delay: 60ms !important; }
.t-col:nth-child(3) { animation-delay: 120ms !important; }
.t-col:nth-child(4) { animation-delay: 180ms !important; }
.t-col:nth-child(5) { animation-delay: 240ms !important; }
@keyframes col-in { to { transform: scaleY(1); } }
@keyframes col-out { to { transform: scaleY(0); } }
.transition-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: clamp(2rem, 6vw, 4rem); font-weight: 800;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0;
}
.transition-overlay.in .transition-label { animation: label-pop 0.45s 0.25s ease forwards; }
@keyframes label-pop {
  0% { opacity: 0; transform: translateY(20px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ Cursor glow ============ */
.cursor-glow {
  position: fixed; width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.10), transparent 65%);
  pointer-events: none; z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
  opacity: 0;
}
@media (hover: none) { .cursor-glow { display: none; } }

/* ============ Background scene ============ */
.bg-scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.bg-grid {
  position: absolute; inset: -50%;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, black 30%, transparent 75%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.35; }
.orb-1 { width: 520px; height: 520px; background: var(--accent); top: -140px; left: -120px; animation: float-1 14s ease-in-out infinite alternate; }
.orb-2 { width: 420px; height: 420px; background: var(--accent-2); bottom: -120px; right: -100px; animation: float-2 18s ease-in-out infinite alternate; opacity: 0.22; }
.orb-3 { width: 320px; height: 320px; background: var(--accent-3); top: 45%; left: 55%; animation: float-3 16s ease-in-out infinite alternate; opacity: 0.14; }
@keyframes float-1 { to { transform: translate(90px, 70px) scale(1.1); } }
@keyframes float-2 { to { transform: translate(-70px, -90px) scale(1.15); } }
@keyframes float-3 { to { transform: translate(-110px, 50px) scale(0.9); } }

/* ============ Navbar ============ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px clamp(20px, 5vw, 56px);
  background: rgba(7, 7, 15, 0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; }
.brand span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-size: 0.92rem; font-weight: 500; color: var(--text-dim);
  position: relative; transition: color 0.25s;
}
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--gradient); border-radius: 2px; transition: width 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.nav-cta {
  color: #fff; padding: 8px 20px; border-radius: 99px;
  background: var(--gradient); font-weight: 600;
  transition: transform 0.25s, box-shadow 0.25s;
}
.nav-links a.nav-cta::after { display: none; }
.nav-links a.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(124, 92, 255, 0.4); }
.nav-right { display: flex; align-items: center; gap: 16px; }

.lang-switch {
  display: flex; background: var(--surface); border: 1px solid var(--surface-border);
  border-radius: 99px; padding: 3px; gap: 2px;
}
.lang-switch button {
  border: none; background: transparent; color: var(--text-dim);
  font-family: var(--font-body); font-size: 0.78rem; font-weight: 600;
  padding: 5px 12px; border-radius: 99px; cursor: pointer; transition: all 0.25s;
}
.lang-switch button.active { background: var(--gradient); color: #fff; }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.hamburger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all 0.3s; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ Layout / pages ============ */
#app { position: relative; z-index: 2; }
.page {
  display: none;
  max-width: 1200px; margin: 0 auto;
  padding: 130px clamp(20px, 5vw, 56px) 80px;
  min-height: 100vh;
}
.page.active { display: block; }

.page-hero { text-align: center; padding: 30px 0 60px; }
.page-hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 800; letter-spacing: -0.03em; }
.page-hero p { color: var(--text-dim); font-size: 1.12rem; max-width: 560px; margin: 16px auto 0; }

.gradient-text {
  background: linear-gradient(120deg, var(--accent), var(--accent-2), var(--accent-3), var(--accent));
  background-size: 300% 300%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: gradient-shift 8s ease infinite;
}
@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ============ Reveal animations ============ */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ============ Hero (home) ============ */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 50px; align-items: center;
  min-height: calc(88vh - 130px); padding-bottom: 40px;
}
.hero-badge {
  display: inline-block; font-size: 0.85rem; font-weight: 600; color: var(--accent-2);
  background: rgba(0, 212, 255, 0.08); border: 1px solid rgba(0, 212, 255, 0.25);
  padding: 7px 16px; border-radius: 99px; margin-bottom: 24px;
}
.hero-title { font-size: clamp(2.6rem, 5.5vw, 4.2rem); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 22px; }
.hero-sub { color: var(--text-dim); font-size: 1.15rem; max-width: 480px; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 32px; border-radius: 99px; font-weight: 600; font-size: 0.98rem;
  font-family: var(--font-body); cursor: pointer; border: none;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s;
  will-change: transform;
}
.btn.full { width: 100%; }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 6px 26px rgba(124, 92, 255, 0.35); }
.btn-primary:hover { box-shadow: 0 10px 40px rgba(124, 92, 255, 0.55); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--surface-border); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); }

/* ============ Code card (hero visual) ============ */
.code-card {
  position: relative; background: rgba(13, 13, 26, 0.85);
  border: 1px solid var(--surface-border); border-radius: var(--radius);
  overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.code-card-header {
  display: flex; align-items: center; gap: 7px;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot.red { background: #ff5f57; } .dot.yellow { background: #febc2e; } .dot.green { background: #28c840; }
.code-card-title { margin-left: 10px; font-size: 0.8rem; color: var(--text-dim); font-family: monospace; }
.code-body { padding: 22px; font-family: 'Cascadia Code', 'Fira Code', monospace; font-size: 0.88rem; line-height: 1.8; overflow-x: auto; }
.c-kw { color: #c792ea; } .c-var { color: #82aaff; } .c-fn { color: #ffcb6b; }
.c-str { color: #c3e88d; } .c-num { color: #f78c6c; } .c-cm { color: #546e7a; }
.code-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(124, 92, 255, 0.12), transparent 45%);
}

/* ============ Tilt ============ */
.tilt { transform-style: preserve-3d; transition: transform 0.2s ease-out; will-change: transform; }

/* ============ Marquee ============ */
.marquee-wrap { margin: 30px 0 90px; }
.marquee {
  overflow: hidden; border-top: 1px solid rgba(255,255,255,0.06); border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 20px 0;
  mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, black 12%, black 88%, transparent);
}
.marquee-track { display: flex; gap: 34px; width: max-content; animation: marquee-scroll 26s linear infinite; }
.marquee-track span { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--text-dim); white-space: nowrap; }
@keyframes marquee-scroll { to { transform: translateX(-50%); } }

/* ============ Section head & cards ============ */
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; }
.section-head p { color: var(--text-dim); margin-top: 10px; }

.cards-grid { display: grid; gap: 22px; margin-bottom: 90px; }
.cards-grid.three { grid-template-columns: repeat(3, 1fr); }
.cards-grid.two { grid-template-columns: repeat(2, 1fr); }

.card {
  position: relative; display: block;
  background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius);
  padding: 32px 28px; overflow: hidden;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
}
.card::before {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s;
  background: radial-gradient(500px circle at var(--mx, 50%) var(--my, 0%), rgba(124, 92, 255, 0.10), transparent 45%);
  pointer-events: none;
}
.card:hover::before { opacity: 1; }
.card:hover { border-color: rgba(124, 92, 255, 0.4); box-shadow: 0 18px 60px rgba(0,0,0,0.35); }
.card-icon { font-size: 2rem; margin-bottom: 16px; }
.card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.card p { color: var(--text-dim); font-size: 0.95rem; }
.card-link { display: inline-block; margin-top: 18px; font-weight: 600; font-size: 0.9rem; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card.big { padding: 38px 34px; }

.feature-list { list-style: none; margin-top: 18px; display: grid; gap: 10px; }
.feature-list li { color: var(--text-dim); font-size: 0.93rem; padding-left: 26px; position: relative; }
.feature-list li::before {
  content: '✦'; position: absolute; left: 0;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============ Clients ============ */
.clients-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
  margin-bottom: 90px;
}
.client-logo {
  display: flex; align-items: center; justify-content: center;
  padding: 34px 28px; min-height: 120px;
  background: var(--surface); border: 1px solid var(--surface-border); border-radius: var(--radius);
  transition: border-color 0.3s, background 0.3s;
}
.client-logo:hover { border-color: rgba(124, 92, 255, 0.4); background: rgba(255,255,255,0.07); }
.client-logo img {
  max-width: 100%; max-height: 52px; object-fit: contain;
  filter: brightness(0) invert(1); /* renders every logo white on the dark theme */
  opacity: 0.75; transition: opacity 0.3s, filter 0.3s;
}
.client-logo:hover img { opacity: 1; }

/* ============ CTA banner ============ */
.cta-banner {
  position: relative; text-align: center; padding: 64px 32px;
  border-radius: 26px; overflow: hidden;
  background:
    radial-gradient(700px circle at 20% 0%, rgba(124, 92, 255, 0.22), transparent 55%),
    radial-gradient(700px circle at 85% 100%, rgba(0, 212, 255, 0.14), transparent 55%),
    var(--bg-soft);
  border: 1px solid var(--surface-border);
}
.cta-banner h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; }
.cta-banner p { color: var(--text-dim); margin: 12px 0 30px; }

/* ============ Timeline (process) ============ */
.timeline { max-width: 760px; margin: 0 auto 90px; display: grid; gap: 8px; }
.timeline-step {
  display: flex; gap: 28px; align-items: flex-start;
  padding: 30px 28px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--surface-border);
  transition: border-color 0.3s, transform 0.3s;
}
.timeline-step:hover { border-color: rgba(124, 92, 255, 0.4); transform: translateX(8px); }
.step-num {
  font-family: var(--font-display); font-size: 2rem; font-weight: 800; line-height: 1;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
  min-width: 58px;
}
.step-body h3 { font-size: 1.2rem; margin-bottom: 8px; }
.step-body p { color: var(--text-dim); font-size: 0.95rem; }

/* ============ About ============ */
.about-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 50px; margin-bottom: 90px; align-items: start; }
.about-text h2 { font-size: 1.6rem; margin: 28px 0 14px; }
.about-text h2:first-child { margin-top: 0; }
.about-text p { color: var(--text-dim); margin-bottom: 14px; }
.profile-card {
  text-align: center; padding: 44px 32px;
  background: var(--surface); border: 1px solid var(--surface-border); border-radius: 24px;
}
.profile-avatar {
  width: 120px; height: 120px; border-radius: 50%; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; padding: 3px;
  background: var(--gradient);
  box-shadow: 0 10px 40px rgba(124, 92, 255, 0.45);
}
.profile-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  object-position: 50% 18%; /* keeps the face centered in the circular crop */
}
.profile-card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.profile-card > p { color: var(--text-dim); font-size: 0.9rem; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; }
.profile-tags span {
  font-size: 0.78rem; font-weight: 600; padding: 5px 14px; border-radius: 99px;
  background: rgba(124, 92, 255, 0.12); border: 1px solid rgba(124, 92, 255, 0.3); color: #b9a8ff;
}

/* ============ Contact ============ */
.contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; margin-bottom: 60px; }
.contact-form {
  background: var(--surface); border: 1px solid var(--surface-border); border-radius: 24px;
  padding: 38px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 8px; color: var(--text-dim); }
.form-group input, .form-group textarea {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--surface-border);
  color: var(--text); font-family: var(--font-body); font-size: 0.95rem;
  transition: border-color 0.25s, box-shadow 0.25s; resize: vertical;
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.18);
}
.form-success { display: none; margin-top: 18px; text-align: center; color: #7effa5; font-weight: 500; }
.form-success.show { display: block; animation: label-pop 0.4s ease; }

.contact-info { display: grid; gap: 22px; align-content: start; }
.info-card {
  background: var(--surface); border: 1px solid var(--surface-border); border-radius: 24px;
  padding: 30px;
}
.info-card h3 { font-size: 1.1rem; margin-bottom: 16px; }
.info-line { display: block; color: var(--text-dim); font-size: 0.93rem; margin-bottom: 10px; transition: color 0.25s; }
a.info-line:hover { color: var(--accent-2); }

.email-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--surface-border); color: var(--text-dim);
  transition: color 0.25s, border-color 0.25s, background 0.25s, transform 0.15s;
}
.copy-btn:hover { color: var(--text); border-color: rgba(124, 92, 255, 0.5); background: rgba(124, 92, 255, 0.12); }
.copy-btn:active { transform: scale(0.92); }
.copy-btn .icon-check { display: none; color: #7effa5; }
.copy-btn.copied .icon-copy { display: none; }
.copy-btn.copied .icon-check { display: block; }
.copy-feedback { display: none; font-size: 0.8rem; font-weight: 600; color: #7effa5; }
.copy-feedback.show { display: inline; animation: label-pop 0.3s ease; }

/* ============ Footer ============ */
.footer { position: relative; z-index: 2; border-top: 1px solid rgba(255,255,255,0.06); padding: 44px 24px; text-align: center; }
.footer-inner { display: grid; gap: 8px; justify-items: center; }
.footer p { color: var(--text-dim); font-size: 0.9rem; }
.footer-legal { font-size: 0.8rem !important; opacity: 0.7; }

/* ============ Responsive ============ */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; min-height: unset; gap: 40px; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-content { text-align: center; }
  .hero-actions { justify-content: center; }
  .cards-grid.three, .cards-grid.two { grid-template-columns: 1fr; }
  .clients-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid, .contact-grid { grid-template-columns: 1fr; }

  .hamburger { display: flex; }
  .nav-links {
    position: fixed; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 8px; padding: 24px;
    background: rgba(7, 7, 15, 0.97); backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transform: translateY(-16px); opacity: 0; pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 10px 0; font-size: 1.05rem; }
}

@media (max-width: 520px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
