:root {
  /* Modern Color Palette */
  --bg-dark: #0f172a;
  --bg-darker: #020617;
  --primary: #38bdf8;
  /* Sky 400 */
  --primary-hover: #0ea5e9;
  /* Sky 500 */
  --secondary: #a855f7;
  /* Purple 500 */
  --accent: #22c55e;
  /* Green 500 */
  --text-main: #f8fafc;
  /* Slate 50 */
  --text-muted: #94a3b8;
  /* Slate 400 */
  --card-bg: rgba(30, 41, 59, 0.7);
  --card-border: rgba(255, 255, 255, 0.1);
  --glass: blur(12px);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-darker);
  background-image:
    radial-gradient(circle at 15% 50%, rgba(56, 189, 248, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.08), transparent 25%);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

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

ul {
  list-style: none;
}

/* Helper Classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 100px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  margin-bottom: 3rem;
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

/* Navbar */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--card-border);
  padding: 1rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

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

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-main);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 60px;
  /* Offset for fixed header */
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.hero-text h1 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.hero-text h1 span {
  background: linear-gradient(to right, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 600px;
}

.btn-group {
  display: flex;
  gap: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg-darker);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-main);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.hero-card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  padding: 2rem;
  border-radius: 24px;
  border: 1px solid var(--card-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-item i {
  color: var(--primary);
  width: 24px;
}

.service-card {
  text-align: center;
  padding: 3rem 2rem;
}

.service-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  background: rgba(56, 189, 248, 0.1);
  width: 80px;
  height: 80px;
  line-height: 80px;
  border-radius: 50%;
  margin-left: auto;
  margin-right: auto;
  transition: var(--transition);
}

.service-card:hover .service-icon {
  background: var(--primary);
  color: var(--bg-darker);
  transform: rotateY(360deg);
}

/* Stats Section */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 3rem;
  border-radius: 20px;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* Testimonials */
.testimonial-card {
  font-style: italic;
  position: relative;
}

.testimonial-card::before {
  content: '"';
  font-size: 5rem;
  position: absolute;
  top: -10px;
  left: 20px;
  opacity: 0.1;
  color: var(--primary);
  font-family: serif;
}

.client-info {
  margin-top: 1.5rem;
  font-style: normal;
  border-top: 1px solid var(--card-border);
  padding-top: 1rem;
}

.client-info h4 {
  color: var(--text-main);
  font-size: 1rem;
}

.hero-right-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.profile-img-container {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--card-border);
  box-shadow: 0 0 50px rgba(56, 189, 248, 0.2);
  position: relative;
  animation: float 6s ease-in-out infinite;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.profile-img-container:hover .profile-img {
  transform: scale(1.1);
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-15px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* Grid Layouts */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

/* Cards */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 2rem;
  border-radius: 16px;
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 2px;
  background: var(--card-border);
}

.timeline-item {
  margin-left: 2rem;
  padding-bottom: 3rem;
  position: relative;
}

.timeline-item::after {
  content: '';
  position: absolute;
  left: -2.35rem;
  top: 0.25rem;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}

.timeline-item h4 {
  font-size: 1.2rem;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.timeline-item span {
  display: block;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

/* Contact Form */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 3rem;
  overflow: hidden;
}

.contact-info h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.contact-detail {
  margin-bottom: 1.5rem;
}

.contact-detail strong {
  display: block;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.contact-detail span {
  color: var(--text-muted);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-main);
  font-family: inherit;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.form-message {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  display: none;
  font-size: 0.9rem;
}

.form-message.success {
  background: rgba(34, 197, 94, 0.1);
  color: #4ade80;
  display: block;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.form-message.error {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  display: block;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Project Carousel */
.projects-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.projects-container {
  flex: 1;
  overflow: hidden;
  /* Strict viewport */
  border-radius: 12px;
  min-width: 0;
}

.projects-carousel {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 0;
  /* Remove gap for perfect % based sliding */
}

.project-card {
  flex: 0 0 100%;
  /* Strict 100% width */
  padding: 4rem 2.5rem 2.5rem 2.5rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  backdrop-filter: var(--glass);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 390px;
  overflow: visible;
  /* Add border-box to ensure padding doesn't affect width if not set globally */
  box-sizing: border-box;
}

.project-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
}

.project-header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 2rem;
  min-height: 50px;
}

.project-header h3 {
  font-size: 1.5rem;
  color: var(--text-main);
  margin: 0;
}

.project-badge {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-block;
}

.project-card p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tech-tag {
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.nav-btn {
  width: 48px;
  height: 48px;
  border: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--primary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 10;
  position: relative;
}

.nav-btn:hover {
  background: var(--primary);
  color: var(--bg-darker);
  border-color: var(--primary);
}

.nav-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.project-indicators {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.indicator {
  width: 12px;
  height: 12px;
  border: 2px solid var(--primary);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background: var(--primary);
  width: 32px;
  border-radius: 6px;
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 0;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
  margin-top: 4rem;
}

/* Responsive */
/* Responsive */
@media (max-width: 1024px) {
  .hero-content {
    gap: 2rem;
  }

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

  .section-title {
    font-size: 2.2rem;
  }

  .container {
    padding: 0 30px;
  }
}

@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 2rem;
    gap: 3rem;
  }

  .hero-text h1 {
    font-size: 2.75rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 800px;
  }

  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }

  .btn-group {
    justify-content: center;
  }

  .hero-right-column {
    flex-direction: column-reverse;
    /* Put image on top of stats if desired, or keep as is */
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
  }

  .hero-card {
    width: 100%;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
    padding: 2.5rem;
    gap: 3rem;
  }

  .contact-info {
    text-align: center;
  }

  .contact-detail {
    display: inline-block;
    vertical-align: top;
    margin: 0 1rem 1rem 1rem;
    text-align: left;
  }

  .timeline::before {
    left: 0;
  }

  .timeline-item {
    margin-left: 1.5rem;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 60px 0;
  }

  .nav-container {
    padding: 0.5rem 0;
  }

  .menu-toggle {
    display: block;
    z-index: 1001;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background: var(--bg-dark);
    flex-direction: column;
    padding: 5rem 2rem;
    border-left: 1px solid var(--card-border);
    transition: right 0.3s ease-in-out;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
  }

  .nav-links.active {
    right: 0;
    display: flex;
  }

  .nav-links a {
    font-size: 1.25rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .projects-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "content content"
      "prev next";
    gap: 1rem;
    width: 100%;
  }

  .nav-btn {
    width: auto;
    /* Grid handles width */
    padding: 0.75rem 1.5rem;
    min-width: 60px;
  }

  .nav-btn-prev {
    grid-area: prev;
    justify-self: start;
  }

  .nav-btn-next {
    grid-area: next;
    justify-self: end;
  }

  .projects-container {
    grid-area: content;
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .project-card {
    padding: 2rem 1.5rem;
    min-height: auto;
  }

  .project-header {
    grid-template-columns: 1fr;
    gap: 1rem;
    text-align: center;
    margin-bottom: 1rem;
  }

  .project-card .btn-outline {
    width: 100%;
    text-align: center;
    margin-top: 1rem;
    padding: 0.6rem;
  }

  .project-badge {
    justify-self: center;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
    /* Stack full width on mobile */
  }

  .contact-detail {
    display: block;
    margin: 0 0 1.5rem 0;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 2rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .btn-group {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .profile-img-container {
    width: 220px;
    height: 220px;
  }

  .stats-container {
    grid-template-columns: 1fr;
    padding: 2rem;
  }

  .contact-wrapper {
    padding: 1.5rem;
  }

  .footer p {
    font-size: 0.9rem;
  }

  .tech-tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
  }
}