/*
 * Portfolio Website Styles
 * Author: Omotayo Adetola Odunubi
 *
 * Approach:
 * - Mobile-first responsive design
 * - CSS custom properties for consistent color system
 * - Poppins font family for all typography
 * - Reusable utility classes for layout and components
 * - Clean, minimal SaaS-style aesthetic
 * - Smooth transitions and hover states
 *
 * Structure:
 * 1. CSS Variables & Reset
 * 2. Base Typography
 * 3. Layout Utilities
 * 4. Header & Navigation
 * 5. Buttons
 * 6. Cards
 * 7. Forms
 * 8. Footer
 * 9. Page-Specific Sections
 * 10. Responsive Media Queries
 */

/* =========================
   1. CSS Variables & Reset
   ========================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

:root {
  /* Color System */
  --color-bg-dark: #0D0D0D;
  --color-header-bg: #111214;
  --color-accent: #3B82F6;
  --color-accent-hover: #1E5AD7;
  --color-bg-light: #F5F5F5;
  --color-border: #D4D4D4;
  --color-text-main: #111111;
  --color-white: #FFFFFF;

  /* Typography */
  --font-primary: 'Poppins', sans-serif;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 3rem;
  --spacing-xl: 4rem;
  --spacing-2xl: 6rem;

  /* Layout */
  --container-max-width: 1100px;
  --border-radius: 8px;
  --transition: all 0.3s ease;

  /* Header & Hero */
  --header-shadow: 0 6px 14px rgba(2, 6, 23, 0.12);
  --hero-gradient: radial-gradient(800px 400px at 10% 10%, rgba(56, 102, 255, 0.06), transparent 40%);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-main);
  background: linear-gradient(-45deg, #f8f9fa, #e9ecef, #dee2e6, #f1f3f5);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  margin: 0;
  padding: 0;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: float 20s ease-in-out infinite;
}

main,
header,
footer {
  position: relative;
  z-index: 1;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.05);
  }
}

/* =========================
   2. Base Typography
   ========================= */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
}

h2 {
  font-size: 1.75rem;
  font-weight: 600;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
}

h4 {
  font-size: 1.1rem;
  font-weight: 600;
}

p {
  margin-bottom: var(--spacing-sm);
}

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

a:hover {
  color: var(--color-accent-hover);
}

small {
  font-size: 0.875rem;
}

/* =========================
   3. Layout Utilities
   ========================= */

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

@media (min-width: 640px) {
  .container {
    padding: 0 var(--spacing-md);
  }
}

.section {
  padding: var(--spacing-lg) 0;
}

@media (min-width: 640px) {
  .section {
    padding: var(--spacing-xl) 0;
  }
}

@media (min-width: 1024px) {
  .section {
    padding: var(--spacing-2xl) 0;
  }
}

.section-light {
  background-color: var(--color-bg-light);
}

.section-dark {
  background-color: var(--color-bg-dark);
  color: var(--color-white);
}

.section-title {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  font-size: 2rem;
  font-weight: 600;
}

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

.grid {
  display: grid;
  gap: var(--spacing-md);
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

/* Services Grid */
.services-grid {
  display: flex !important;
  flex-direction: row !important;
  gap: var(--spacing-md);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent) var(--color-bg-light);
}

.services-grid::-webkit-scrollbar {
  height: 8px;
}

.services-grid::-webkit-scrollbar-track {
  background: var(--color-bg-light);
  border-radius: 10px;
}

.services-grid::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 10px;
}

.service-card {
  min-width: 320px !important;
  max-width: 380px !important;
  width: 350px !important;
  min-height: 280px;
  flex-shrink: 0 !important;
  scroll-snap-align: start;
  position: relative;
}

.service-card .card-icon {
  display: none;
}

/* =========================
   4. Header & Navigation
   ========================= */

.header {
  background-color: var(--color-header-bg);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--header-shadow);
  pointer-events: auto;
}

@media (max-width: 640px) {
  .header {
    padding: 0.5rem 0;
  }
}

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

.logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-white);
  text-decoration: none;
  transition: var(--transition);
}

.logo:hover {
  color: var(--color-white);
}

@media (max-width: 640px) {
  .logo {
    font-size: 1.1rem;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  pointer-events: auto;
}

.nav > .btn {
  display: none;
}

.nav-links {
  display: none;
  list-style: none;
  gap: var(--spacing-md);
}

.nav-links.active {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 300px;
  max-width: 85vw;
  background-color: var(--color-bg-dark);
  padding: var(--spacing-lg) var(--spacing-md);
  padding-top: 4rem;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  animation: slideInRight 0.3s ease-out;
  overflow-y: auto;
  pointer-events: all !important;
  cursor: default;
  isolation: isolate;
}

.nav-close {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: var(--color-white);
  font-size: 2rem;
  cursor: pointer !important;
  padding: 0.5rem;
  line-height: 1;
  transition: var(--transition);
  z-index: 2;
  min-width: 44px;
  min-height: 44px;
  border-radius: 4px;
  pointer-events: all !important;
}

.nav-links.active .nav-close {
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-close:hover {
  background: var(--color-accent);
  color: var(--color-white);
  transform: rotate(90deg);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Mobile menu backdrop */
.nav-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9998;
  animation: fadeIn 0.3s ease-out;
  pointer-events: none;
}

.nav-backdrop.active {
  display: block;
  pointer-events: auto;
  cursor: pointer;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.nav-links li {
  width: 100%;
  pointer-events: all !important;
  position: relative;
  z-index: 10001;
}

.nav-links li a {
  color: var(--color-white);
  font-weight: 500;
  font-size: 1.1rem;
  transition: var(--transition);
  padding: 1rem 1.25rem;
  display: block;
  border-radius: 8px;
  width: 100%;
  cursor: pointer !important;
  text-decoration: none;
  position: relative;
  z-index: 10002;
  pointer-events: all !important;
  isolation: isolate;
}

.nav-links li a:hover {
  background-color: rgba(59, 130, 246, 0.15);
  color: var(--color-accent);
  transform: translateX(5px);
}

.nav-links li a:active {
  background-color: rgba(59, 130, 246, 0.5) !important;
}

/* DEBUG: Make links visually obvious for testing */
.nav-links.active li a {
  background-color: rgba(255, 255, 255, 0.05);
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.75rem;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  align-items: center;
  touch-action: manipulation;
  z-index: 101;
  position: relative;
}

/* Hide hamburger when menu is open - close button will be used instead */
.hamburger.active {
  opacity: 0;
  pointer-events: none;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--color-white);
  transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* =========================
   5. Buttons
   ========================= */

.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.btn-outline:hover {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.btn-link {
  background: none;
  color: var(--color-accent);
  padding: 0;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-link:hover {
  color: var(--color-accent-hover);
}

/* =========================
   6. Cards
   ========================= */

.card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  transition: var(--transition);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-icon {
  width: 60px;
  height: 60px;
  background-color: var(--color-bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--spacing-sm);
  font-size: 1.5rem;
  color: var(--color-accent);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.card-description {
  color: #666;
  margin-bottom: var(--spacing-sm);
}

.card-image {
  width: 100%;
  height: 180px;
  background-color: var(--color-bg-light);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  margin-bottom: var(--spacing-sm);
  border: 1px dashed var(--color-border);
  overflow: hidden;
}

@media (min-width: 640px) {
  .card-image {
    height: 200px;
  }
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background-color: var(--color-white);
}

.card-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--color-bg-light);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: var(--spacing-xs);
}

/* =========================
   7. Forms
   ========================= */

.form-group {
  margin-bottom: var(--spacing-md);
}

.form-label {
  display: block;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  color: var(--color-text-main);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  font-family: var(--font-primary);
  font-size: 16px;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

@media (min-width: 640px) {
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 1rem;
  }
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* =========================
   8. Footer
   ========================= */

.footer {
  background-color: var(--color-bg-dark);
  color: var(--color-white);
  padding: var(--spacing-lg) 0 var(--spacing-md);
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  text-align: center;
}

.footer-text {
  opacity: 0.8;
  font-size: 0.9rem;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
}

.footer-social a {
  color: var(--color-white);
  opacity: 0.8;
  font-weight: 500;
  transition: var(--transition);
}

.footer-social a:hover {
  opacity: 1;
  color: var(--color-accent);
}

.footer-credit {
  font-size: 0.875rem;
  opacity: 0.7;
  margin-top: var(--spacing-sm);
}

/* =========================
   9. Page-Specific Sections
   ========================= */

/* Hero Section */
.hero {
  padding: var(--spacing-lg) 0;
  background-color: var(--color-white);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -10%;
  width: 120%;
  height: 60%;
  background: var(--hero-gradient);
  pointer-events: none;
  z-index: 0;
  filter: blur(14px);
}

@media (min-width: 640px) {
  .hero {
    padding: var(--spacing-xl) 0;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: var(--spacing-2xl) 0;
  }
}

.hero-content {
  display: grid;
  gap: var(--spacing-lg);
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: var(--spacing-sm);
}

.hero-title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

@media (min-width: 640px) {
  .hero-title {
    font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  }
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 2.5rem;
  }
}

.hero-description {
  font-size: 1rem;
  line-height: 1.7;
  color: #666;
  margin-bottom: var(--spacing-md);
}

@media (min-width: 640px) {
  .hero-description {
    font-size: 1.05rem;
  }
}

@media (min-width: 1024px) {
  .hero-description {
    font-size: 1.1rem;
    line-height: 1.6;
  }
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  align-items: center;
  border-top: 1px solid rgba(2, 6, 23, 0.04);
  padding-top: 1.1rem;
  margin-top: 1.5rem;
}

/* Client Logos Section - Auto-Scrolling */
.client-logos-section {
  margin-top: 3rem;
  width: 100%;
  padding: 2rem 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(245,245,245,0.3) 50%, rgba(255,255,255,0) 100%);
}

.client-logos-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #666;
  text-align: center;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.client-logos-wrapper {
  width: 100%;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.client-logos-track {
  display: flex;
  width: fit-content;
  animation: scrollLogos 40s linear infinite;
}

.client-logos-track:hover {
  animation-play-state: paused;
}

@keyframes scrollLogos {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.client-logos {
  display: flex;
  gap: 4rem;
  align-items: center;
  padding: 1.5rem 0;
}

.client-logos img {
  height: 100px;
  width: auto;
  min-width: 120px;
  max-width: 280px;
  filter: none;
  opacity: 1;
  transition: transform 0.3s ease, opacity 0.3s ease;
  flex-shrink: 0;
  object-fit: contain;
  cursor: pointer;
}

.client-logos img:hover {
  transform: scale(1.15);
  opacity: 0.85;
}

@media (min-width: 640px) {
  .client-logos-title {
    font-size: 1.3rem;
    letter-spacing: 1.5px;
  }

  .client-logos {
    gap: 5rem;
  }

  .client-logos img {
    height: 120px;
    min-width: 140px;
    max-width: 300px;
  }
}

@media (min-width: 1024px) {
  .client-logos-section {
    margin-top: 4rem;
    padding: 3rem 0;
  }

  .client-logos-title {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    letter-spacing: 2px;
  }

  .client-logos {
    gap: 6rem;
  }

  .client-logos img {
    height: 140px;
    min-width: 160px;
    max-width: 350px;
  }

  .client-logos-track {
    animation: scrollLogos 50s linear infinite;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .client-logos-track {
    animation: none;
  }
}

.hero-image {
  width: 100%;
  max-width: 300px;
  height: auto;
  aspect-ratio: 5/6;
  margin: 0 auto;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: var(--transition);
}

@media (min-width: 768px) {
  .hero-image {
    width: 300px;
    height: 360px;
  }
}

.hero-image:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: var(--border-radius);
}

/* Services Grid */
.services-grid {
  display: grid;
  gap: var(--spacing-md);
}

/* Projects Grid */
.projects-grid {
  display: flex;
  gap: var(--spacing-md);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
  scrollbar-width: thin;
}

.projects-grid::-webkit-scrollbar {
  height: 8px;
}

.projects-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
}

.projects-grid::-webkit-scrollbar-thumb {
  background: rgba(59, 130, 246, 0.4);
  border-radius: 10px;
}

.projects-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(59, 130, 246, 0.6);
}

.projects-grid .card {
  min-width: 300px;
  max-width: 350px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* Testimonials */
.testimonials-grid {
  display: grid;
  gap: var(--spacing-md);
}

.testimonial-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
}

.testimonial-quote {
  font-style: italic;
  color: #666;
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.testimonial-author {
  font-weight: 600;
  color: var(--color-text-main);
}

.testimonial-role {
  font-size: 0.9rem;
  color: #999;
}

/* Process Steps */
.process-steps {
  display: flex;
  gap: var(--spacing-md);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--spacing-sm);
  -webkit-overflow-scrolling: touch;
}

.process-steps::-webkit-scrollbar {
  height: 8px;
}

.process-steps::-webkit-scrollbar-track {
  background: var(--color-bg-light);
  border-radius: 10px;
}

.process-steps::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 10px;
}

.process-step {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  padding: var(--spacing-md);
  text-align: center;
  min-width: 280px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

.process-number {
  display: inline-block;
  width: 50px;
  height: 50px;
  background-color: var(--color-accent);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 auto var(--spacing-sm);
}

.process-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.process-description {
  color: #666;
  font-size: 0.95rem;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--spacing-sm);
}

.tool-item {
  background-color: var(--color-bg-light);
  padding: var(--spacing-sm);
  border-radius: var(--border-radius);
  text-align: center;
  font-weight: 500;
  font-size: 0.9rem;
}

/* Tools Marquee Animation */
.container-full {
  width: 100%;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
}

.tools-marquee {
  overflow: hidden;
  position: relative;
  width: 100%;
  padding: var(--spacing-md) 0;
}

.tools-track {
  display: flex;
  gap: 3rem;
  animation: scroll 30s linear infinite;
  width: fit-content;
}

.tools-track:hover {
  animation-play-state: paused;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.tool-logo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  min-width: 120px;
  padding: 1rem;
  background-color: var(--color-white);
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}

.tool-logo-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tool-logo-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.tool-logo-item span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-main);
  text-align: center;
  line-height: 1.2;
}

/* Skills Section */
.skills-group {
  margin-bottom: var(--spacing-lg);
}

.skills-group-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--color-accent);
}

.skills-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-xs);
}

.skills-list li {
  padding: 0.5rem;
  background-color: var(--color-bg-light);
  border-radius: var(--border-radius);
  font-size: 0.9rem;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: var(--spacing-md);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--spacing-md);
  border-left: 2px solid var(--color-border);
  padding-left: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  width: 14px;
  height: 14px;
  background-color: var(--color-accent);
  border-radius: 50%;
}

.timeline-year {
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: var(--spacing-xs);
}

.timeline-title {
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.timeline-description {
  color: #666;
  font-size: 0.95rem;
}

/* Contact Section */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.contact-info {
  margin-top: var(--spacing-lg);
  text-align: center;
}

.contact-email {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: var(--spacing-md);
}

/* CTA Section */
.cta-section {
  padding: var(--spacing-2xl) 0;
  text-align: center;
}

.cta-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

@media (min-width: 640px) {
  .cta-title {
    font-size: 1.75rem;
  }
}

@media (min-width: 1024px) {
  .cta-title {
    font-size: 2rem;
  }
}

.cta-text {
  font-size: 1rem;
  color: #666;
  margin-bottom: var(--spacing-md);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 640px) {
  .cta-text {
    font-size: 1.05rem;
  }
}

@media (min-width: 1024px) {
  .cta-text {
    font-size: 1.1rem;
  }
}

/* =========================
   10. Responsive Media Queries
   ========================= */

@media (min-width: 768px) {
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-content {
    grid-template-columns: 1fr 1fr;
  }

  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
}

@media (min-width: 768px) {
  .projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow-x: visible;
    scroll-snap-type: none;
  }

  .projects-grid .card {
    min-width: auto;
    max-width: none;
  }
}

@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .graphics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================
   Graphics Design Grid
   ========================= */

.graphics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--spacing-md);
}

.graphics-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  background-color: var(--color-bg-light);
  transition: var(--transition);
  height: auto;
  cursor: pointer;
}

.graphics-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.graphics-item::after {
  content: '🔍';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}

.graphics-item:hover::after {
  opacity: 0.8;
}

.graphics-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  transition: var(--transition);
  max-height: 400px;
}

.graphics-item:hover img {
  transform: scale(1.05);
}

@media (min-width: 640px) {
  .graphics-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .graphics-item img {
    max-height: 300px;
  }
}

@media (min-width: 1024px) {
  .graphics-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .graphics-item img {
    max-height: 250px;
  }
}

/* Lightbox Modal */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  padding: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.95);
  animation: fadeIn 0.3s ease-out;
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  animation: zoomIn 0.3s ease-out;
  border-radius: var(--border-radius);
}

@keyframes zoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: var(--color-white);
  font-size: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition);
  z-index: 10000;
}

.lightbox-close:hover {
  color: var(--color-accent);
  transform: scale(1.1);
}

.lightbox-caption {
  margin-top: 20px;
  text-align: center;
  color: var(--color-white);
  font-size: 1.1rem;
  max-width: 700px;
}

/* =========================
   Animations & Dynamic Effects
   ========================= */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Apply animations to sections - with reduced motion support */
@media (prefers-reduced-motion: no-preference) {
  .hero .hero-content {
    animation: heroFadeIn 0.5s ease-out forwards;
  }

  @keyframes heroFadeIn {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .hero-text {
    animation: slideInLeft 0.8s ease-out;
  }

  .hero-image {
    animation: slideInRight 0.8s ease-out 0.2s both;
  }
}

.card {
  animation: fadeInUp 0.6s ease-out both;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
.card:nth-child(5) { animation-delay: 0.5s; }
.card:nth-child(6) { animation-delay: 0.6s; }

.section-title {
  animation: fadeInUp 0.6s ease-out;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

/* Add will-change for better performance on animated elements */
.card,
.hero-image,
.tool-logo-item,
.graphics-item {
  will-change: transform;
}

/* =========================
   Accessibility
   ========================= */

:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* =========================
   Mobile-Specific Optimizations
   ========================= */

/* Prevent zoom on input focus for iOS */
@supports (-webkit-touch-callout: none) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Optimize tap highlights */
a,
button,
.btn,
.card {
  -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
}

/* Better scrolling on iOS */
.nav-links.active,
.process-steps {
  -webkit-overflow-scrolling: touch;
}

/* Disable animations on mobile to improve performance */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile-only: Stack hero CTA buttons vertically for better touch */
@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
    width: 100%;
  }

  .hero-cta .btn,
  .hero-cta .btn-link {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* Ensure images don't break layout on small screens */
img {
  max-width: 100%;
  height: auto;
}

/* Better mobile menu positioning */
@media (max-width: 767px) {
  .nav-links.active {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
}

/* =========================
   Project Modal
   ========================= */

.project-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.project-modal.active {
  display: flex;
}

.project-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.project-modal-content {
  position: relative;
  background-color: var(--color-white);
  border-radius: 12px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 100001;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.project-modal-close {
  position: sticky;
  top: 1rem;
  right: 1rem;
  float: right;
  background: rgba(0, 0, 0, 0.1);
  border: none;
  color: var(--color-text);
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  line-height: 1;
  transition: var(--transition);
  z-index: 100002;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-modal-close:hover {
  background: var(--color-accent);
  color: var(--color-white);
  transform: rotate(90deg);
}

#modalBody {
  padding: 2rem;
  clear: both;
}

.modal-project-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.modal-project-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.modal-project-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--color-bg-light);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.modal-project-description {
  color: #666;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.modal-project-features {
  margin-bottom: 1.5rem;
}

.modal-project-features h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.modal-project-features ul {
  list-style: none;
  padding: 0;
}

.modal-project-features li {
  padding: 0.5rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: #666;
}

.modal-project-features li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: bold;
}

.modal-project-tech {
  margin-bottom: 1.5rem;
}

.modal-project-tech h4 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.modal-tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.modal-tech-tag {
  padding: 0.5rem 1rem;
  background-color: var(--color-bg-light);
  border-radius: 20px;
  font-size: 0.875rem;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.modal-project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-accent);
  color: var(--color-white);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: var(--transition);
}

.modal-project-link:hover {
  background-color: var(--color-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

@media (max-width: 640px) {
  .project-modal-content {
    max-height: 95vh;
    border-radius: 12px 12px 0 0;
    margin-top: auto;
  }

  #modalBody {
    padding: 1.5rem;
  }

  .modal-project-title {
    font-size: 1.5rem;
  }
}

/* =========================
   Analytics Section
   ========================= */

.analytics-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  color: var(--color-white) !important;
  position: relative;
  overflow: hidden;
  padding: 5rem 0 !important;
  margin: 0 !important;
}

.analytics-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.analytics-section .section-title {
  color: var(--color-white);
  margin-bottom: 1rem;
}

.analytics-grid {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

@media (min-width: 640px) {
  .analytics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .analytics-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 2rem;
  }
}

.stat-card {
  background: rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 16px !important;
  padding: 2rem 1.5rem !important;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.4);
}

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

.stat-card.visible {
  opacity: 1;
  transform: translateY(0);
  animation: fadeInUp 0.6s ease-out forwards;
}

.stat-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  transition: all 0.4s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(5deg);
  background: rgba(255, 255, 255, 0.25);
}

.stat-icon svg {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-white);
  margin-bottom: 0.5rem;
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .stat-number {
    font-size: 2.5rem;
  }
}

.stat-prefix,
.stat-suffix {
  font-size: 1.5rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  display: inline-block;
}

.stat-label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-white);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-sublabel {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

/* Staggered animation delays */
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }
.stat-card:nth-child(6) { animation-delay: 0.6s; }
.stat-card:nth-child(7) { animation-delay: 0.7s; }
.stat-card:nth-child(8) { animation-delay: 0.8s; }
.stat-card:nth-child(9) { animation-delay: 0.9s; }

/* Gradient shimmer effect on numbers */
@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.stat-card.counting .stat-number {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.8) 25%,
    rgba(255, 255, 255, 1) 50%,
    rgba(255, 255, 255, 0.8) 75%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 2s linear infinite;
}

/* =========================
   Mobile Optimization Enhancements
   ========================= */

/* Improve tap targets on mobile */
@media (max-width: 768px) {
  /* Ensure all interactive elements have minimum 44px touch targets */
  a, button, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
  }

  /* Improve link spacing in navigation */
  .nav-links a {
    padding: 0.875rem 1rem;
    display: block;
  }

  /* Better spacing for cards on mobile */
  .card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
  }

  /* Improve form field touch targets */
  .form-group input,
  .form-group textarea,
  .form-group select {
    padding: 1rem;
    font-size: 16px; /* Prevents zoom on iOS */
    min-height: 48px;
  }

  /* Better hero text sizing on mobile */
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero-description {
    font-size: 1rem;
    line-height: 1.6;
  }

  /* Improve section padding on mobile */
  .section {
    padding: 3rem 0;
  }

  /* Better grid spacing on mobile */
  .grid {
    gap: 1.5rem;
  }

  /* Improve hamburger menu touch target */
  .hamburger {
    min-width: 48px;
    min-height: 48px;
    padding: 0.75rem;
  }

  /* Better spacing for process steps */
  .process-steps {
    gap: 2rem;
  }

  /* Improve footer link spacing */
  .footer-social a {
    padding: 0.5rem 1rem;
    margin: 0.25rem;
  }
}

/* Small mobile devices (< 480px) */
@media (max-width: 480px) {
  /* Reduce hero title size for very small screens */
  .hero-title {
    font-size: 1.75rem;
  }

  /* Better container padding */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Stack CTA buttons on very small screens */
  .cta-section .btn {
    width: 100%;
    margin-bottom: 1rem;
  }

  /* Improve card spacing */
  .card {
    padding: 1.25rem;
  }
}

/* Improve scrolling performance on mobile */
@media (max-width: 768px) {
  * {
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.2);
  }

  /* Smooth momentum scrolling */
  body, .nav-links.active {
    -webkit-overflow-scrolling: touch;
  }

  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
  }

  /* Optimize images for mobile */
  img {
    max-width: 100%;
    height: auto;
  }
}

/* Landscape orientation optimizations */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 3rem 0;
  }

  .nav-links.active {
    width: 250px;
  }
}

/* Accessibility improvements for mobile */
@media (max-width: 768px) {
  /* Larger focus indicators on mobile */
  a:focus, button:focus, input:focus, select:focus, textarea:focus {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
  }

  /* Skip to content link for keyboard navigation */
  .skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-accent);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
  }

  .skip-to-content:focus {
    top: 0;
  }
}

/* Print styles optimization */
@media print {
  .header, .footer, .hamburger, .nav, .btn {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .section {
    page-break-inside: avoid;
  }
}
