/* ─── RESET & VARIABLES ─────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;user-select: none;
}

:root {
  --bg:        #050810;
  --bg2:       #090d1a;
  --surface:   rgba(255,255,255,0.04);
  --border:    rgba(255,255,255,0.08);
  --blue:      #1d7aff;
  --blue-glow: rgba(29,122,255,0.35);
  --cyan:      #00d4ff;
  --yellow:    #f5c842;
  --white:     #f0f2f8;
  --muted:     rgba(240,242,248,0.45);
  --radius:    16px;
  --max:       1200px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none; /* replaced by custom cursor */
}

/* ─── CUSTOM CURSOR ─────────────────────────────────────────────── */
.cursor {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: background 0.2s, transform 0.1s;
}
.cursor-follower {
  position: fixed;
  width: 36px; height: 36px;
  border: 1.5px solid rgba(29,122,255,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: transform 0.12s ease, width 0.3s, height 0.3s, border-color 0.3s;
}
body:has(a:hover) .cursor-follower,
body:has(button:hover) .cursor-follower {
  width: 56px; height: 56px;
  border-color: var(--cyan);
}

/* ─── NOISE OVERLAY ─────────────────────────────────────────────── */
.noise {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px;
}

/* ─── HEADER ─────────────────────────────────────────────────────── */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0 5vw;
  transition: background 0.4s, backdrop-filter 0.4s, border-bottom 0.4s;
}
.header.scrolled {
  background: rgba(5,8,16,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max);
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.logo span { color: var(--blue); }

.nav { display: flex; gap: 0; }
.nav-link {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 100px;
  transition: color 0.2s, background 0.2s;
  letter-spacing: 0.02em;
}
.nav-link:hover {
  color: var(--white);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: none;
  padding: 6px;
}
.hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s, opacity 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); }

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: 72px; left: 0; right: 0;
  background: rgba(5,8,16,0.97);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 5vw;
  gap: 4px;
  z-index: 99;
  transform: translateY(-110%);
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1);
}
.mobile-menu.open { transform: translateY(0); }
.mobile-link {
  text-decoration: none;
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 600;
  font-family: 'Syne', sans-serif;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s, padding-left 0.2s;
}
.mobile-link:last-child { border-bottom: none; }
.mobile-link:hover { color: var(--blue); padding-left: 8px; }

/* ─── HERO ───────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 5vw 80px;
  overflow: hidden;
}

#star-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* Grid lines */
.hero-grid {
  position: absolute; inset: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 5vw;
  pointer-events: none;
  z-index: 0;
}
.grid-line {
  width: 1px;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(255,255,255,0.04) 20%,
    rgba(255,255,255,0.04) 80%,
    transparent 100%
  );
  animation: grid-fade 3s ease calc(var(--i) * 0.3s) forwards;
  opacity: 0;
}
@keyframes grid-fade { to { opacity: 1; } }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(29,122,255,0.1);
  border: 1px solid rgba(29,122,255,0.25);
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 100px;
  margin-bottom: 40px;
}
.badge-dot {
  width: 7px; height: 7px;
  background: var(--blue);
  border-radius: 50%;
  animation: pulse-dot 2s ease infinite;
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 0 0 rgba(29,122,255,0.6); }
  50%      { box-shadow: 0 0 0 6px rgba(29,122,255,0); }
}

.hero-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-bottom: 32px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.outline-text {
  -webkit-text-stroke: 2px transparent;
  background: linear-gradient(135deg, var(--blue) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0.5;
}

.hero-sub {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto 48px;
  line-height: 1.7;
}
.hero-sub em {
  color: var(--yellow);
  font-style: normal;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* ─── BUTTONS ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 100px;
  padding: 14px 28px;
  transition: all 0.3s;
  cursor: none;
}
.btn svg { width: 16px; transition: transform 0.3s; }
.btn:hover svg { transform: translateX(4px); }

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 0 var(--blue-glow);
}
.btn-primary:hover {
  background: #3a8fff;
  box-shadow: 0 8px 32px var(--blue-glow), 0 0 0 4px rgba(29,122,255,0.15);
  transform: translateY(-2px);
}

.social-links {
  display: flex;
  gap: 12px;
}
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  transition: all 0.3s;
  text-decoration: none;
}
.social-btn svg { width: 18px; height: 18px; }
.social-btn:hover {
  color: var(--white);
  border-color: var(--blue);
  background: rgba(29,122,255,0.1);
  transform: translateY(-2px);
}

/* Scroll indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 2;
}
.scroll-line {
  width: 1px; height: 56px;
  background: linear-gradient(to bottom, var(--blue), transparent);
  animation: scroll-pulse 2s ease infinite;
}
@keyframes scroll-pulse {
  0%   { opacity: 1; transform: scaleY(1); transform-origin: top; }
  100% { opacity: 0; transform: scaleY(0); transform-origin: top; }
}
.hero-scroll-indicator span {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── SECTION COMMONS ─────────────────────────────────────────────── */
section { padding: 120px 5vw; }

.section-header {
  text-align: center;
  margin-bottom: 80px;
}
.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 14px;
}
.section-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

/* ─── SERVICES ───────────────────────────────────────────────────── */
.services {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.services-grid {
  max-width: var(--max);
  margin: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.service-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 36px;
  overflow: hidden;
  transition: border-color 0.4s, transform 0.4s;
  animation-delay: var(--delay);
}
.service-card:hover {
  border-color: rgba(29,122,255,0.4);
  transform: translateY(-6px);
}
.service-card:hover .card-glow {
  opacity: 1;
}
.card-glow {
  position: absolute;
  bottom: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(29,122,255,0.2), transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.card-number {
  font-family: 'Syne', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.1em;
  margin-bottom: 24px;
}
.card-icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(29,122,255,0.1);
  border: 1px solid rgba(29,122,255,0.2);
  border-radius: 14px;
  margin-bottom: 24px;
}
.card-icon svg {
  width: 22px; height: 22px;
  stroke: var(--blue);
}
.service-card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--white);
}
.service-card p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

/* ─── PORTFOLIO ──────────────────────────────────────────────────── */
.portfolio { background: var(--bg); }

.portfolio-list {
  max-width: var(--max);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.project-item {
  display: grid;
  grid-template-columns: 120px 1fr 380px;
  align-items: center;
  gap: 48px;
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 0.4s;
  position: relative;
}
.project-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 0; height: 100%;
  background: rgba(29,122,255,0.04);
  transition: width 0.4s ease;
  z-index: 0;
}
.project-item:hover::before { width: 100%; }
.project-item:hover { padding-left: 24px; }

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative; z-index: 1;
}
.project-num {
  font-family: 'Syne', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.1em;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--muted);
}

.project-body {
  position: relative; z-index: 1;
}
.project-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  line-height: 1.1;
}
.project-desc {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 24px;
  max-width: 420px;
}
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--blue);
  font-weight: 600;
  font-size: 0.9rem;
  transition: gap 0.3s, color 0.2s;
}
.project-link svg { width: 16px; transition: transform 0.3s; }
.project-link:hover { color: var(--cyan); gap: 14px; }
.project-link:hover svg { transform: translateX(4px); }

.project-image {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
  z-index: 1;
}
.project-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
  display: block;
}
.project-item:hover .project-image img { transform: scale(1.05); }
.image-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(29,122,255,0.15), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}
.project-item:hover .image-overlay { opacity: 1; }

/* ─── FOOTER ─────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 5vw;
  text-align: center;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.footer-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.75rem;
  color: var(--white);
}
.footer-logo span { color: var(--blue); }
.footer p { color: var(--muted); font-size: 0.875rem; }
.footer a {
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
}
.footer a:hover { color: var(--blue); }

/* ─── SCROLL REVEAL ──────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1),
              transform 0.8s cubic-bezier(0.16,1,0.3,1);
  transition-delay: var(--delay, 0ms);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: 1fr 1fr; }
  .project-item  { grid-template-columns: 1fr; gap: 28px; }
  .project-image { max-width: 100%; aspect-ratio: 16/9; }
}

@media (max-width: 768px) {
  .nav { display: none; }
  .hamburger { display: flex; }
  .services-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: clamp(2.4rem, 11vw, 4rem); }
  body { cursor: auto; }
  .cursor, .cursor-follower { display: none; }
}

@media (max-width: 480px) {
  section { padding: 80px 5vw; }
  .project-item:hover { padding-left: 0; }
}