/* Base Styles and Variables */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap");

:root {
  /* HSL Values for Tailwind-like behavior */
  --background: 0 0% 100%;
  --foreground: 220 15% 15%;

  --card: 0 0% 100%;
  --card-foreground: 220 15% 15%;

  --popover: 0 0% 100%;
  --popover-foreground: 220 15% 15%;

  --primary: 160 60% 40%;
  --primary-foreground: 0 0% 100%;
  --primary-glow: 160 70% 50%;

  --secondary: 220 14% 96%;
  --secondary-foreground: 220 15% 15%;

  --muted: 220 14% 96%;
  --muted-foreground: 220 10% 46%;

  --accent: 160 40% 95%;
  --accent-foreground: 160 60% 30%;

  --destructive: 0 84% 60%;
  --destructive-foreground: 0 0% 100%;

  --border: 220 13% 91%;
  --input: 220 13% 91%;
  --ring: 160 60% 40%;

  --radius: 0.875rem;

  --dark-section: 220 20% 8%;
  --dark-section-foreground: 0 0% 96%;

  --surface: 220 20% 98%;
  --surface-foreground: 220 15% 15%;

  --font-heading: "Space Grotesk", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

/* Helper to use HSL variables */
.bg-background {
  background-color: hsl(var(--background));
}

.bg-foreground {
  background-color: hsl(var(--foreground));
}

.text-foreground {
  color: hsl(var(--foreground));
}

.text-background {
  color: hsl(var(--background));
}

/* Base Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-width: 0;
  border-style: solid;
  border-color: hsl(var(--border));
}

html {
  scroll-behavior: smooth;
  font-family: var(--font-body);
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: hsl(var(--foreground));
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  background: none;
  font-family: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

svg {
  display: block;
}

/* Utilities matches React/Tailwind config */
.container-main {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  max-width: 1400px;
  /* 2xl screen from tailwind config */
}

@media (min-width: 640px) {
  .container-main {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    max-width: 640px;
  }
}

@media (min-width: 768px) {
  .container-main {
    padding-left: 2rem;
    padding-right: 2rem;
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .container-main {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container-main {
    max-width: 1280px;
  }
}

@media (min-width: 1400px) {
  .container-main {
    max-width: 1400px;
  }
}

/* Section Padding from index.css */
.section-padding {
  padding-top: 5rem;
  padding-bottom: 5rem;
}

@media (min-width: 768px) {
  .section-padding {
    padding-top: 7rem;
    padding-bottom: 7rem;
  }
}

@media (min-width: 1024px) {
  .section-padding {
    padding-top: 8rem;
    padding-bottom: 8rem;
  }
}

/* Flex & Grid Utilities */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-2\.5 {
  gap: 0.625rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

.hidden {
  display: none;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.z-10 {
  z-index: 10;
}

.z-50 {
  z-index: 50;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.object-cover {
  object-fit: cover;
}

.text-center {
  text-align: center;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Grid System */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .sm\:flex {
    display: flex;
  }

  .sm\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .md\:flex {
    display: flex;
  }

  .md\:hidden {
    display: none;
  }

  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .md\:h-\[72px\] {
    height: 72px;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .lg\:gap-7 {
    gap: 1.75rem;
  }

  .lg\:gap-20 {
    gap: 5rem;
  }
}

/* Animations from tailwind.config */
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes fade-up {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Component Styles */

/* TopBar */
.top-bar {
  background-color: hsl(var(--foreground));
  color: hsl(var(--background));
  font-size: 0.75rem;
  /* text-xs */
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.top-bar a {
  opacity: 0.8;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-bar a:hover {
  opacity: 1;
}

.social-icon {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background-color: hsla(var(--background) / 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  color: inherit;
}

.social-icon:hover {
  background-color: hsla(var(--background) / 0.2);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: hsl(var(--background));
  border-bottom: 1px solid transparent;
  transition: all 0.3s;
}

.header.scrolled {
  background-color: hsla(var(--background) / 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
  border-bottom-color: hsla(var(--border) / 0.3);
}

.header-container {
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (min-width: 768px) {
  .header-container {
    height: 72px;
  }
}

/* Logo */
.logo-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.logo-box {
  width: 4.25rem;
  height: 2.25rem;
  /* background: linear-gradient(
    to bottom right,
    hsl(var(--primary)),
    hsl(var(--primary-glow))
  ); */
  /* border-radius: 0.75rem; */
  /* xl is 0.75rem usually, checked usage */
  display: flex;
  align-items: center;
  justify-content: center;
  /* box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); */
  /* color: hsl(var(--primary-foreground)); */
}

.logo-text {
  font-size: 1.5rem;
  /* text-xl */
  font-weight: 700;
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
  /* color: hsl(var(--foreground)); */
  color: hsl(var(--primary));
  margin-left: -17px;
}

/* Nav */
.nav-link {
  font-size: 0.875rem;
  /* text-sm */
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.nav-link:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--muted));
}

.btn-primary {
  background: linear-gradient(
    to right,
    hsl(var(--primary)),
    hsl(var(--primary-glow))
  );
  color: hsl(var(--primary-foreground));
  padding: 0.625rem 1.5rem;
  border-radius: 0.75rem;
  /* xl */
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0 transparent;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px hsla(var(--primary) / 0.25);
}

/* Hero Section */
.hero-section {
  position: relative;
  height: 80vh;
  min-height: 550px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    hsla(220, 20%, 8%, 0.7),
    hsla(160, 50%, 20%, 0.4),
    hsla(220, 20%, 8%, 0.8)
  );
}

.hero-glow {
  position: absolute;
  top: 33%;
  left: 33%;
  width: 500px;
  height: 500px;
  background-color: hsla(var(--primary) / 0.08);
  border-radius: 9999px;
  filter: blur(150px);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 10;
  color: white;
  animation: fade-up 0.8s ease-out forwards;
}

.hero-subtitle {
  color: hsl(var(--primary-glow));
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  display: block;
}

@media (min-width: 768px) {
  .hero-subtitle {
    font-size: 0.875rem;
  }
}

.hero-title {
  font-size: 2.25rem;
  line-height: 1.1;
  font-weight: 700;
  font-family: var(--font-heading);
  color: white;
  margin-bottom: 0;
  white-space: pre-line;
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 3rem;
  }
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3.75rem;
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 4.5rem;
  }
}

/* About Section */
.about-section {
  background-color: hsl(var(--background));
}

.section-label {
  color: hsl(var(--primary));
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.section-title {
  color: hsl(var(--foreground));
  font-size: 1.875rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .section-title {
    font-size: 2.25rem;
  }
}

@media (min-width: 1024px) {
  .section-title {
    font-size: 3rem;
  }
}

.about-text {
  color: hsl(var(--muted-foreground));
  line-height: 1.625;
  font-size: 1rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .about-text {
    font-size: 1.125rem;
  }
}

.badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: hsl(var(--muted));
  border-radius: 0.75rem;
  padding: 0.875rem 1.25rem;
  border: 1px solid hsla(var(--border) / 0.4);
}

.badge-icon-box {
  width: 2.5rem;
  height: 2.5rem;
  background-color: hsla(var(--primary) / 0.1);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--primary));
}

.badge-text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}

.about-img-container {
  position: relative;
  border-radius: 1.5rem;
  /* 24px */
  overflow: hidden;
  box-shadow: 0 25px 50px -12px hsla(var(--primary) / 0.1);
}

.about-img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}

@media (min-width: 1024px) {
  .about-img {
    height: 520px;
  }
}

/* Stats Section */
.stats-section {
  padding-top: 4rem;
  padding-bottom: 4rem;
  background: linear-gradient(
    to right,
    hsl(var(--primary)),
    hsl(var(--primary-glow))
  );
  color: hsl(var(--primary-foreground));
  text-align: center;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .stats-section {
    padding-top: 6rem;
    padding-bottom: 6rem;
  }
}

.stat-value {
  font-size: 3rem;
  font-weight: 700;
  color: hsl(var(--primary-foreground));
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .stat-value {
    font-size: 3.75rem;
  }
}

@media (min-width: 1024px) {
  .stat-value {
    font-size: 4.5rem;
  }
}

.stat-label {
  font-size: 1rem;
  font-weight: 500;
  color: hsla(var(--primary-foreground) / 0.8);
}

@media (min-width: 768px) {
  .stat-label {
    font-size: 1.125rem;
  }
}

/* Services */
.surface-section {
  background-color: hsl(var(--surface));
  color: hsl(var(--surface-foreground));
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
  }
}

@keyframes blob-bounce {
  0% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -50px) scale(1.1);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.9);
  }

  100% {
    transform: translate(0, 0) scale(1);
  }
}

.service-card {
  position: relative;
  background-color: hsl(var(--card));
  border-radius: 1.25rem;
  /* Slightly rounder */
  padding: 2.5rem 2rem;
  /* More vertical padding */
  border: 1px solid hsla(var(--border) / 0.6);
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.02),
    0 2px 4px -1px rgba(0, 0, 0, 0.02);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  /* Square aspect ratio */
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  overflow: hidden;
  isolation: isolate;
}

/* Bubble 1 (Top Left) */
.service-card::before {
  content: "";
  position: absolute;
  top: -20%;
  left: -20%;
  width: 15rem;
  height: 15rem;
  background: hsla(var(--primary) / 0.08);
  border-radius: 50%;
  filter: blur(40px);
  z-index: -1;
  animation: blob-bounce 10s infinite ease-in-out alternate;
  opacity: 0.6;
  transition: opacity 0.4s ease;
}

/* Bubble 2 (Bottom Right) */
.service-card::after {
  content: "";
  position: absolute;
  bottom: -20%;
  right: -20%;
  width: 12rem;
  height: 12rem;
  background: hsla(var(--primary) / 0.06);
  border-radius: 50%;
  filter: blur(40px);
  z-index: -1;
  animation: blob-bounce 12s infinite ease-in-out alternate-reverse;
  opacity: 0.5;
  transition: opacity 0.4s ease;
}

.service-card:hover::before,
.service-card:hover::after {
  opacity: 1;
  background: hsla(var(--primary) / 0.12);
}

.service-card:hover {
  transform: translateY(-8px);
  border-color: hsla(var(--primary) / 0.3);
  box-shadow:
    0 20px 40px -5px hsla(var(--primary) / 0.15),
    0 10px 15px -6px hsla(var(--primary) / 0.1);
}

.service-icon-box {
  width: 4rem;
  height: 4rem;
  background: hsl(var(--surface));
  border: 1px solid hsla(var(--border) / 0.8);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: hsl(var(--primary));
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Bounce effect */
  flex-shrink: 0;
}

.service-card:hover .service-icon-box {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: transparent;
  transform: scale(1.1) rotate(3deg);
  box-shadow: 0 10px 20px -5px hsla(var(--primary) / 0.3);
}

.service-title {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: 0.75rem;
  color: hsl(var(--foreground));
  transition: color 0.3s ease;
}

.service-card:hover .service-title {
  color: hsl(var(--primary));
}

.service-desc {
  color: hsl(var(--muted-foreground));
  font-size: 1.125rem;
  line-height: 1.625;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Portfolio grid fallback */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.portfolio-item {
  position: relative;
  height: 300px;
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
}

.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.portfolio-item:hover .portfolio-img {
  transform: scale(1.05);
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, hsla(210, 25%, 5%, 0.9), transparent);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  color: #fff;
}

.portfolio-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-family: var(--font-heading);
  color: #fff;
}

.portfolio-desc {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Footer */
.footer {
  background-color: hsl(var(--dark-section));
  color: hsl(var(--dark-section-foreground));
  padding-top: 5rem;
  /* Increased top padding for better separation */
  padding-bottom: 2rem;
}

.footer-logo-box {
  width: 4.5rem;
  /* Slight increase */
  height: 2.5rem;
  /* background-color: hsl(var(--primary));
  border-radius: 0.5rem; */
  display: flex;
  align-items: center;
  justify-content: center;
  /* color: hsl(var(--primary-foreground)); */
  flex-shrink: 0;
}

.footer-company-name {
  font-size: 1.5rem;
  /* Increased to match header/hero scale */
  font-weight: 700;
  font-family: var(--font-heading);
  color: hsl(var(--dark-section-foreground));
  line-height: 1;
}

.footer-title {
  font-size: 1.125rem;
  /* Slightly smaller than company name for hierarchy, standard h5 size */
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
  /* Increased margin */
  font-family: var(--font-heading);
  height: 2.5rem;
  /* Match Logo height EXACTLY */
  display: flex;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-text {
  font-size: 0.9375rem;
  /* 15px */
  color: hsla(var(--dark-section-foreground) / 0.7);
  line-height: 1.625;
  margin-bottom: 1.5rem;
}

.footer-text-no-gap {
  font-size: 0.9375rem;
  /* 15px */
  color: hsla(var(--dark-section-foreground) / 0.7);
  line-height: 1.625;
  margin-bottom: 0.5rem;
}

.footer-social-link {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background-color: hsla(var(--primary) / 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsla(var(--dark-section-foreground) / 0.8);
  transition: all 0.3s;
}

.footer-social-link:hover {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  transform: translateY(-2px);
}

.footer-link {
  display: block;
  font-size: 0.9375rem;
  color: hsla(var(--dark-section-foreground) / 0.7);
  transition: all 0.2s;
  /* Removed margin-bottom to rely on flex gap */
}

.footer-link:hover {
  color: hsl(var(--primary-glow));
  padding-left: 0.25rem;
  /* Slight nudge on hover */
}

.footer-divider {
  border-top: 1px solid hsla(var(--dark-section-foreground) / 0.1);
  padding-top: 2rem;
  margin-top: 4rem;
}

.footer-copyright {
  text-align: center;
  font-size: 0.875rem;
  color: hsla(var(--dark-section-foreground) / 0.4);
}
