@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Darker+Grotesque:wght@400;500;600;700;800;900&display=swap");

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

/* ─── Base ───────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: "Inter", "Darker Grotesque", sans-serif;
  background-color: #050505;
  color: #ededed;
  overflow-x: hidden;
  font-size: 1rem;
  padding-top: 5rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: #fff; color: #000; }

/* ─── Animated gradient background ──────────────────────────── */
.gradient-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(120,119,198,0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255,77,77,0.10)   0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(0,112,243,0.10)   0%, transparent 50%);
  animation: gradientShift 18s ease infinite;
}

@keyframes gradientShift {
  0%,100% { opacity: 1;   transform: scale(1);    }
  50%      { opacity: 0.7; transform: scale(1.08); }
}

/* ─── Grid pattern overlay ───────────────────────────────────── */
.grid-pattern {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  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: 50px 50px;
  pointer-events: none;
}

/* ─── Glass utility ──────────────────────────────────────────── */
.glass {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ─── Fade-in animations ─────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}

.animate-fade-in-up { animation: fadeInUp 0.75s cubic-bezier(0.4,0,0.2,1) forwards; }
.animate-fade-in    { animation: fadeIn   1s   ease-out              forwards; }

.delay-100 { animation-delay: 0.10s; opacity: 0; }
.delay-200 { animation-delay: 0.20s; opacity: 0; }
.delay-300 { animation-delay: 0.30s; opacity: 0; }
.delay-400 { animation-delay: 0.40s; opacity: 0; }
.delay-500 { animation-delay: 0.50s; opacity: 0; }

/* ─── Glow text ──────────────────────────────────────────────── */
.glow-text { text-shadow: 0 0 60px rgba(255,255,255,0.07); }

/* ─── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 9999px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.25);
  max-width: calc(100vw - 2rem);
  transition: box-shadow 0.3s, background 0.3s;
}

.navbar .flex {
  gap: 0.25rem;
  padding: 0.375rem 0.5rem;
}

.navbar img[alt="Logo"] {
  height: 2rem; width: 2rem;
  margin-right: 0.375rem;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  object-fit: contain;
  flex-shrink: 0;
}

/* Nav links */
.nav-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(161,161,170,1);
  border-radius: 9999px;
  padding: 0.375rem 0.875rem;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover,
.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.nav-link.active {
  background: rgba(255,255,255,0.10);
  color: #fff;
}

/* ─── Router loading bar ─────────────────────────────────────── */
.router-loading-bar {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 3px;
  z-index: 2000;
  background: linear-gradient(90deg, #4f8cff, #a259ff, #f953c6, #43e97b);
  background-size: 300% 100%;
  animation: router-bar-gradient 1.1s linear infinite;
  opacity: 1;
  transition: opacity 0.4s;
}

@keyframes router-bar-gradient {
  0%   { background-position: 0%   50%; }
  100% { background-position: 100% 50%; }
}

/* ─── Pulse ──────────────────────────────────────────────────── */
@keyframes pulse {
  0%,100% { opacity: 1;    }
  50%      { opacity: 0.45; }
}
.pulse { animation: pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }

/* ─── Bento cards ────────────────────────────────────────────── */
.bento-card {
  position: relative;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 2rem;
  transition:
    border-color 0.3s cubic-bezier(0.4,0,0.2,1),
    transform    0.3s cubic-bezier(0.4,0,0.2,1),
    background   0.3s cubic-bezier(0.4,0,0.2,1);
}

.bento-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  -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.35s ease;
  pointer-events: none;
}

.bento-card:hover::before { opacity: 1; }

.bento-card:hover {
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-3px);
  background: rgba(255,255,255,0.045);
}

.bento-card a { position: relative; z-index: 10; pointer-events: auto; }

/* ─── Social links ───────────────────────────────────────────── */
.social-link {
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}

.social-link::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.04));
  -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.3s;
}

.social-link:hover::before { opacity: 1; }
.social-link:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.05);
}

/* ─── Blog cards ─────────────────────────────────────────────── */
.blog-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 1.5rem;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}

.blog-card:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.14);
}

.blog-card:hover .blog-arrow { transform: translateX(4px); }
.blog-arrow { transition: transform 0.3s ease; }

/* ─── Service cards ──────────────────────────────────────────── */
.service-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 2rem;
  transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.service-card:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.16);
}

/* ─── Mega menu ──────────────────────────────────────────────── */
.mega-menu {
  position: absolute;
  top: calc(100% + 1rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 900px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}

.mega-menu.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.mega-menu-item {
  transition: all 0.2s ease;
  cursor: pointer;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1rem;
}

.mega-menu-item:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.055);
  border-color: rgba(255,255,255,0.13);
}

.mega-menu-icon {
  width: 40px; height: 40px;
  display: flex;
  align-items: center; justify-content: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  font-size: 20px;
}

/* ─── Prose ──────────────────────────────────────────────────── */
.prose {
  color: #d4d4d8;
  max-width: 65ch;
  font-size: 1rem;
  line-height: 1.75;
}
.prose-invert { color: #d4d4d8; }

.prose h1,.prose h2,.prose h3,.prose h4,.prose h5,.prose h6 {
  color: #fff; font-weight: 700;
  margin-top: 2em; margin-bottom: 0.75em;
  line-height: 1.25; letter-spacing: -0.02em;
}
.prose h1 { font-size: 2.25em; }
.prose h2 { font-size: 1.75em; }
.prose h3 { font-size: 1.375em; }
.prose h4 { font-size: 1.125em; }

.prose p { margin: 1.25em 0; }

.prose a { color: #60a5fa; text-decoration: underline; font-weight: 500; transition: color 0.2s; }
.prose a:hover { color: #93c5fd; }
.prose strong { color: #fff; font-weight: 600; }

.prose code {
  color: #fbbf24; font-size: 0.875em;
  background: rgba(255,255,255,0.08);
  padding: 0.15em 0.4em; border-radius: 0.3rem;
}

.prose pre {
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1rem;
  padding: 1.25em 1.5em;
  overflow-x: auto; margin: 1.5em 0;
}
.prose pre code { background: transparent; padding: 0; color: #e4e4e7; font-size: 0.875em; }

.prose ul,.prose ol { padding-left: 1.5em; margin: 1.25em 0; }
.prose li { margin: 0.4em 0; }

.prose blockquote {
  font-style: italic;
  border-left: 3px solid rgba(255,255,255,0.15);
  padding-left: 1em; margin: 1.5em 0;
  color: #a1a1aa;
}

.prose img { border-radius: 1rem; margin: 2em 0; }

.prose hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 3em 0;
}

.prose-lg { font-size: 1.0625rem; line-height: 1.8; }

/* ─── Utilities ──────────────────────────────────────────────── */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Responsive: Mobile navbar ─────────────────────────────── */
@media (max-width: 767px) {
  body { padding-top: 4.5rem; }

  .navbar {
    top: 0.75rem;
    left: 0.75rem; right: 0.75rem;
    transform: none;
    width: calc(100vw - 1.5rem);
    max-width: calc(100vw - 1.5rem);
    border-radius: 1.5rem;
  }

  .navbar .flex {
    padding: 0.4rem 0.625rem;
  }

  /* Card radius tighter on small screens */
  .bento-card  { border-radius: 1.25rem; }
  .service-card{ border-radius: 1.25rem; }
  .blog-card   { border-radius: 1rem;    }
}

/* ─── Responsive: Typography clamp ──────────────────────────── */
@media (max-width: 639px) {
  .text-6xl { font-size: clamp(2.25rem, 11vw, 3.75rem) !important; }
  .text-7xl { font-size: clamp(2.5rem,  13vw, 4.5rem)  !important; }
  .text-8xl { font-size: clamp(3rem,    15vw, 5rem)     !important; }
  .text-9xl { font-size: clamp(3.5rem,  18vw, 6rem)     !important; }
  .text-5xl { font-size: clamp(2rem,    9vw,  3rem)     !important; }

  .py-24    { padding-top: 4rem    !important; padding-bottom: 4rem    !important; }
  .pt-32    { padding-top: 5rem    !important; }
  .mb-24    { margin-bottom: 3.5rem !important; }

  /* Service cards: reduce padding */
  .service-card { padding: 1.5rem !important; }

  /* Featured bento card: let it breathe without fixed height */
  [class*="min-h-[500px]"] { min-height: 260px  !important; }
  [class*="min-h-[280px]"] { min-height: auto   !important; }
  [class*="min-h-[240px]"] { min-height: auto   !important; }
}

/* ─── Responsive: Grid stacking ─────────────────────────────── */
@media (max-width: 767px) {
  /* Force all md:col-span-* to full width */
  [class*="md:col-span-"] {
    grid-column: 1 / -1 !important;
  }

  /* Calendar embed: shorter on mobile */
  [style*="height: 700px"] { height: 480px !important; }
}

/* ─── Responsive: Contact layout ────────────────────────────── */
@media (max-width: 1023px) {
  [class*="lg:col-span-2"],
  [class*="lg:col-span-1"] {
    grid-column: 1 / -1 !important;
  }
}
