/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
:root {
  /* Colors - Dark Theme (Default) */
  --bg-color: #050507;
  --surface-color: #121216;
  --surface-light: #1c1c24;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a5;
  --accent-color: #00f2ea;
  --accent-secondary: #ff0055;
  --gradient-main: linear-gradient(135deg, var(--accent-color), #7000ff);

  /* Typography */
  --font-main: 'Outfit', sans-serif;

  /* Spacing */
  --container-width: 1200px;
  --header-height: 80px;

  /* Effects */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-backdrop: blur(10px);
  --transition: all 0.3s ease;
  --shadow-lg: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.text-accent {
  color: var(--accent-color);
}

/* animated-background */
.background-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-color);
}

.blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.6;
  border-radius: 50%;
  animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(112, 0, 255, 0.4) 0%, transparent 70%);
  animation-duration: 25s;
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(0, 242, 234, 0.3) 0%, transparent 70%);
  animation-duration: 30s;
  animation-direction: alternate-reverse;
}

.blob-3 {
  top: 40%;
  left: 40%;
  width: 40vw;
  height: 40vw;
  background: radial-gradient(circle, rgba(255, 0, 85, 0.2) 0%, transparent 70%);
  animation-duration: 20s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  100% {
    transform: translate(30px, -30px) scale(1.1);
  }
}

/* Pulsating Button Glow */
.btn {
  animation: btnPulse 2s ease-in-out infinite;
}

@keyframes btnPulse {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(0, 242, 234, 0.3);
  }

  50% {
    box-shadow: 0 0 40px rgba(0, 242, 234, 0.6), 0 0 60px rgba(112, 0, 255, 0.3);
  }
}

/* 3D Card Tilt on Hover */
.service-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.service-card:hover {
  transform: translateY(-10px) rotateX(5deg) rotateY(-5deg);
}

/* Counter Suffix */
/* Counter Suffix handled in HTML */
.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-item h3 {
  display: inline-block;
}

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

html {
  font-size: 62.5%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-size: 1.6rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

section {
  padding: 5rem 0;
  position: relative;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ==========================================================================
   2. TYPOGRAPHY & UTILITIES
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: 2rem;
}

h1 {
  font-size: 6rem;
}

h2 {
  font-size: 4.8rem;
  text-align: center;
  margin-bottom: 6rem;
}

h3 {
  font-size: 2.8rem;
}

h4 {
  font-size: 2rem;
}

.text-gradient {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn {
  display: inline-block;
  padding: 1.5rem 3.5rem;
  background: var(--gradient-main);
  color: #fff;
  border-radius: 50px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 242, 234, 0.3);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #7000ff, var(--accent-color));
  z-index: -1;
  transition: var(--transition);
  opacity: 0;
}

.btn:hover::before {
  opacity: 1;
}

.badge {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

/* ==========================================================================
   3. COMPONENTS
   ========================================================================== */
/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  backdrop-filter: var(--glass-backdrop);
  background: rgba(5, 5, 7, 0.7);
  border-bottom: 1px solid var(--glass-border);
}

header .container {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -1px;
  display: inline-flex;
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links {
  display: flex;
  gap: 4rem;
  margin: 0;
  /* Remove default ul margin */
}

.nav-links a {
  font-size: 1.4rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
}

.nav-links a:hover,
.nav-links a.active {
  opacity: 1;
  color: var(--accent-color);
}

.hamburger {
  display: none;
  cursor: pointer;
  z-index: 1002;
  /* Ensure above drawer */
}

.bar {
  width: 25px;
  height: 3px;
  background-color: var(--text-primary);
  margin: 5px 0;
  transition: 0.4s;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  /* Background handled by global blob wrapper */
}

.hero-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6rem;
  max-width: 1200px;
}

.hero-text {
  flex: 1;
  max-width: 650px;
}

.hero-text h1 {
  font-size: 5rem;
  line-height: 1.1;
}

.hero-image {
  flex: 0 0 380px;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.hero-image::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  aspect-ratio: 1;
  background: var(--gradient-main);
  filter: blur(80px);
  z-index: -1;
  opacity: 0.3;
  border-radius: 50%;
}

.hero-image img {
  width: 100%;
  max-height: 550px;
  object-fit: cover;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.hero-tag {
  display: inline-block;
  margin-bottom: 2rem;
  padding: 0.8rem 2rem;
  border: 1px solid var(--accent-color);
  border-radius: 50px;
  color: var(--accent-color);
  font-weight: 600;
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.hero p.lead {
  font-size: 2rem;
  color: var(--text-secondary);
  margin-bottom: 4rem;
  text-align: left;
}

.stat-grid {
  display: flex;
  justify-content: flex-start;
  gap: 6rem;
  margin-top: 5rem;
}

.stat-item h3 {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.stat-item p {
  color: var(--text-secondary);
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (max-width: 900px) {
  .hero-container {
    flex-direction: column-reverse;
    text-align: center;
    gap: 3rem;
  }

  .hero-text h1 {
    font-size: 3.2rem;
  }

  .hero p.lead {
    text-align: center;
    font-size: 1.6rem;
    margin-bottom: 3rem;
  }

  .hero-image {
    flex: 0 0 auto;
    width: 150px;
    height: 150px;
    max-width: 150px;
    margin: 0 auto;
  }

  .hero-image img {
    border-radius: 50%;
    height: 100%;
    object-fit: cover;
  }

  .stat-grid {
    justify-content: center;
    gap: 3rem;
  }
}

/* Services */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-top: 4rem;
}

.service-card {
  background: var(--surface-color);
  padding: 4rem 3rem;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
  opacity: 0;
  transition: var(--transition);
}

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

.service-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-color);
  box-shadow: 0 20px 40px -10px rgba(0, 242, 234, 0.15);
}

.service-icon {
  width: 70px;
  height: 70px;
  background: var(--surface-light);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.5rem;
  color: var(--accent-color);
  border: 1px solid var(--glass-border);
  transition: transform 0.3s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(0, 242, 234, 0.1);
}

.service-card h3 {
  margin-bottom: 1.5rem;
  font-size: 2.4rem;
  font-weight: 700;
}

.service-card p {
  color: var(--text-secondary);
  font-size: 1.6rem;
  line-height: 1.7;
  margin-top: auto;
}

/* Tablet Override */
@media (max-width: 992px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Override */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* Tech Stack Grid */
.tech-section {
  padding: 4rem 0;
  border-top: 1px solid var(--glass-border);
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.02);
}

.tech-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3rem;
}

.tech-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2.5rem;
  background: var(--surface-color);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  transition: var(--transition);
  cursor: default;
}

.tech-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
  box-shadow: 0 10px 30px -10px rgba(0, 242, 234, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.tech-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  /* Ensure icons are visible in dark mode, some might need filter */
}

.tech-card span {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: var(--transition);
}

.tech-card:hover span {
  color: var(--text-primary);
}

@media (max-width: 768px) {
  .tech-grid {
    gap: 1.5rem;
  }

  .tech-card {
    padding: 1rem 2rem;
  }
}

/* Work / Portfolio */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 3rem;
}

.brand-card {
  background: var(--surface-color);
  height: 150px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--glass-border);
  transition: var(--transition);
  padding: 2rem;
}

.brand-card:hover {
  background: var(--surface-light);
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.brand-card img {
  max-width: 100%;
  max-height: 80px;
  filter: grayscale(100%) opacity(0.7);
  transition: var(--transition);
}

.brand-card:hover img {
  filter: grayscale(0%) opacity(1);
}

/* Contact */
.contact-section {
  text-align: center;
  background: linear-gradient(180deg, var(--bg-color) 0%, var(--surface-color) 100%);
}

.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 3rem;
  margin-top: 4rem;
}

.contact-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2.5rem;
  background: var(--surface-light);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.6rem;
}

.contact-btn:hover {
  background: var(--surface-color);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* Footer */
footer {
  padding: 4rem 0;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 1.4rem;
}

/* Utilities */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  h1 {
    font-size: 4rem;
  }

  h2 {
    font-size: 3.2rem;
  }

  .hamburger {
    display: block;
  }

  /* Hamburger Bars - ensure color in light mode */
  .bar {
    background-color: var(--text-primary);
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background: var(--surface-color);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: 0.4s;
    border-left: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    z-index: 1001;
  }

  .nav-links.active {
    right: 0;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
  }

  /* Adjust nav gap for mobile */
  nav {
    gap: 1.5rem;
  }

  .stat-grid {
    flex-direction: column;
    gap: 4rem;
    margin-top: 4rem;
  }

  .service-card {
    padding: 2rem 1.5rem;
    /* Modern Card Design */
    background: rgba(18, 18, 22, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Inline-Block Alignment (Iteration 7) */
    display: block;
    text-align: center;
  }

  .service-icon {
    display: none;
  }

  .service-card h3 {
    display: block;
    font-size: 1.8rem;
    margin-bottom: 1rem;
    text-align: center;
  }

  .service-card p {
    color: #e0e0e0;
    font-size: 1.4rem;
    margin-top: 1.5rem;
    text-align: center;
  }

  footer p {
    padding: 0 4rem;
    /* Force text wrap */
    line-height: 1.8;
  }

  /* --- UI/UX Improvements (Iteration 2) --- */
  section {
    padding: 2.5rem 0;
  }

  .container {
    padding: 0 1.5rem;
  }

  /* Typography Scale Down */
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 3rem;
    margin-bottom: 3rem;
  }

  /* Hero & alignment */
  .hero-container {
    gap: 1.5rem;
    /* Reduced Gap (Image-Badge) */
  }

  /* Increase Header-Image Space */
  .hero-image {
    margin-top: 4rem;
  }

  /* Reduce Image-Badge Space (status-badge margin) */
  .status-badge {
    margin-top: 1rem;
    margin-bottom: 2rem;
  }

  /* Header Logo Truncation Fix */
  .logo {
    font-size: 2rem;
  }

  .logo-icon svg {
    width: 20px;
    height: 20px;
  }

  /* Stats Alignment */
  .stat-grid {
    gap: 2rem;
  }

  .stat-item {
    align-items: center;
  }

  .stat-item h3 {
    font-size: 3rem;
  }

  /* Contrast Fixes & 2-Col Adjustments */
  .service-card p {
    color: #e0e0e0;
    font-size: 1.4rem;
    /* Grid placement & alignment */
    grid-column: 1 / -1;
    text-align: center;
    margin-top: 1rem;
  }



  /* Force 2-column work grid */
  .work-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .brand-card {
    height: 100px;
    padding: 1rem;
  }

  .brand-card img {
    filter: none;
    opacity: 0.9;
  }
}

/* Premium Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1.6rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(0, 242, 234, 0.3);
  border-radius: 50px;
  margin-bottom: 2rem;
  margin-top: 3rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 242, 234, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: default;
}

.status-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 234, 0.1), transparent);
  transform: translateX(-100%);
  transition: 0.5s;
}

.status-badge:hover {
  border-color: var(--accent-color);
  box-shadow: 0 0 30px rgba(0, 242, 234, 0.2);
  transform: translateY(-2px);
}

.status-badge:hover::before {
  transform: translateX(100%);
}

.status-dot {
  display: block;
  width: 10px;
  height: 10px;
  background-color: #00ff88;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 10px #00ff88;
}

.status-dot::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background-color: inherit;
  border-radius: 50%;
  opacity: 0.8;
  animation: pulse-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.status-text {
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }

  50% {
    opacity: 0.5;
  }

  100% {
    transform: translate(-50%, -50%) scale(2.5);
    opacity: 0;
  }
}

/* Creative Hero Image Redesign */
.hero-image {
  perspective: 1000px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-wrapper {
  position: relative;
  width: 380px;
  height: 420px;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.hero-image-wrapper:hover {
  transform: rotateY(5deg) rotateX(5deg);
}

.hero-image img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  /* Resetting previous shadow */
  z-index: 2;
  transition: all 0.5s ease;
}

.tech-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 90%;
  background: linear-gradient(135deg, var(--accent-color), #7000ff);
  filter: blur(60px);
  opacity: 0.4;
  z-index: 1;
  border-radius: 50%;
  animation: pulse-glow 4s ease-in-out infinite alternate;
}

.tech-ring {
  position: absolute;
  top: -20px;
  left: -20px;
  right: -20px;
  bottom: -20px;
  border: 2px dashed rgba(0, 242, 234, 0.3);
  border-radius: 40px;
  z-index: 1;
  animation: spin-ring 20s linear infinite;
}

.tech-ring::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  background: var(--accent-color);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-color);
}

.tech-ring-inner {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 1px solid rgba(112, 0, 255, 0.3);
  border-radius: 35px;
  z-index: 1;
  transition: all 0.5s ease;
}

.hero-image-wrapper:hover .tech-ring {
  border-color: rgba(0, 242, 234, 0.6);
  animation-duration: 10s;
}

.hero-image-wrapper:hover .tech-ring-inner {
  transform: scale(0.95);
  border-color: rgba(112, 0, 255, 0.6);
}

.hero-image-wrapper:hover img {
  transform: translateZ(20px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

@keyframes spin-ring {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse-glow {
  0% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(0.9);
  }

  100% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1.1);
  }
}

/* Mobile Adjustments */
@media (max-width: 900px) {
  .hero-image-wrapper {
    width: 300px;
    height: 340px;
  }
}

/* Animated Logo Cursor */
.cursor {
  display: inline-block;
  color: var(--accent-color);
  animation: blink 1s step-end infinite;
  font-weight: 800;
  margin-left: 2px;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

/* Logo Icon */
.logo-icon {
  display: inline-flex;
  margin-right: 0.8rem;
  color: var(--accent-color);
  align-items: center;
  /* Precise correction based on 3px center diff */
}

.logo-icon svg {
  width: 24px;
  /* Exact match to 2.4rem text */
  height: 24px;
  stroke-width: 2.5px;
  filter: drop-shadow(0 0 5px rgba(0, 242, 234, 0.5));
}

/* Footer Break for Mobile */
@media (max-width: 768px) {
  .footer-break {
    display: block;
    width: 100%;
    visibility: hidden;
    height: 0;
    margin: 0.5rem 0;
  }
}