/* BrightLoop Agency Website - Custom Styles */

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

:root {
  --primary: #000000;
  --secondary: #4F46E5;
  --accent: #F59E0B;
  --bg-light: #FFFFFF;
  --bg-cream: #FFFBF5;
  --text-dark: #1F2937;
  --text-light: #6B7280;
  --border: #E5E7EB;
}

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

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.4s;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-dark);
  background: var(--bg-cream);
  line-height: 1.6;
  overflow-x: hidden;
  min-width: 320px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

/* Navbar */
nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-link {
  position: relative;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hero Section */
.hero {
  min-height: 85vh;
  display: grid;
  place-items: center;
  padding: 4rem 1rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(79, 70, 229, 0.08) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(245, 158, 11, 0.06) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
  z-index: 0;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(3deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(-3deg);
  }
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: shimmer 3s linear infinite;
  position: relative;
  display: inline-block;
}

.gradient-text::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: blur(20px);
  opacity: 0.3;
  z-index: -1;
}

@keyframes shimmer {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* Cards */
.card {
  background: white;
  border-radius: 1.5rem;
  padding: 2.5rem;
  border: 1px solid var(--border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

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

.card:hover::before {
  transform: scaleX(1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

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

.btn-primary:hover {
  background: var(--secondary);
  transform: scale(1.05);
}

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

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

/* Image Showcase */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.craft-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.craft-item {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  aspect-ratio: 1;
}

.craft-large {
  grid-column: span 2;
  grid-row: span 2;
}

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

  .craft-large {
    grid-column: span 1;
    grid-row: span 1;
  }
}

@media (max-width: 640px) {
  .craft-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .craft-item {
    aspect-ratio: 16 / 10;
  }
}

.showcase-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  border-radius: 1rem;
}

.showcase-image:hover {
  transform: scale(1.05);
}

/* Case study card styling */
.rounded-2xl {
  position: relative;
  overflow: hidden;
}

.rounded-2xl img {
  transition: transform 0.4s ease;
}

.rounded-2xl:hover img {
  transform: scale(1.05);
}

/* Improve case study text spacing */
.grid.md\\:grid-cols-2 p.leading-relaxed {
  line-height: 1.8;
  font-size: 1rem;
}

.grid.md\\:grid-cols-2 h3 {
  line-height: 1.3;
}

/* Metrics card padding */
.grid.grid-cols-3 > div {
  padding: 1rem 0.75rem;
}

/* Stats Section */
.stat-card {
  text-align: center;
  padding: 2rem 1rem;
}

.stat-number-wrapper {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.25rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.stat-number-fixed {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  white-space: nowrap;
}

.stat-suffix {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
}

.stat-label {
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* Footer */
footer {
  background: var(--primary);
  color: white;
  margin-top: 8rem;
}

.footer-link {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: white;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: var(--bg-cream);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Product Card */
.product-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 2.5rem;
  border-radius: 1.5rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

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

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

.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.product-card h3 {
  color: white;
  font-size: 1.75rem;
  line-height: 1.3;
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: white;
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.3s ease;
  margin-top: auto;
}

.product-link:hover {
  gap: 1rem;
}

.product-link svg {
  transition: transform 0.3s ease;
}

.product-link:hover svg {
  transform: translateX(4px);
}

/* Tech Stack Pills */
.tech-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: white;
  border: 2px solid var(--border);
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.tech-pill:hover {
  border-color: var(--secondary);
  background: var(--secondary);
  color: white;
  transform: translateY(-2px);
}

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

.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* Form Styles */
.form-input,
.form-textarea {
  width: 100%;
  padding: 1rem 1.5rem;
  border: 2px solid var(--border);
  border-radius: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

/* Section Spacing */
section {
  padding: 6rem 1rem;
  position: relative;
}

section.bg-white {
  background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
  width: 100%;
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
}

/* Decorative background patterns */
section:nth-child(even):not(.bg-white):not(.bg-black) {
  position: relative;
}

section:nth-child(even):not(.bg-white):not(.bg-black)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(79, 70, 229, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: white;
  z-index: 999;
  padding: 2rem;
  flex-direction: column;
  gap: 2rem;
}

.mobile-menu.active {
  display: flex;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.menu-toggle span {
  width: 28px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .desktop-nav {
    display: none;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  section {
    padding: 3rem 1rem;
  }

  .product-card {
    padding: 2rem;
    min-height: 280px;
  }

  .product-card h3 {
    font-size: 1.5rem;
  }

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

/* Scroll animations */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
  will-change: transform, opacity;
}

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

/* Ensure no horizontal overflow on grid items */
.grid > * {
  min-width: 0;
  overflow: visible;
}

/* View Transitions API Support */
@supports (view-transition-name: none) {
  .page-link {
    view-transition-name: main-content;
  }
}

/* Icon Styling */
.card svg {
  color: var(--secondary);
  transition: all 0.3s ease;
}

.card:hover svg {
  color: var(--primary);
  transform: scale(1.1);
}

/* Learn More Link Animation */
a:has(.inline-block) {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Logo Hover Effect */
a.group:has(img) {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: all 0.3s ease;
}

a.group:has(img):hover {
  transform: scale(1.02);
  opacity: 0.9;
}

a.group:has(img):hover img {
  transform: rotate(-5deg);
}

/* Lightbox Styles */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  z-index: 10000;
  max-width: 90%;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid white;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10001;
  line-height: 1;
  padding: 0;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid white;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10001;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-counter {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  z-index: 10001;
}

@media (max-width: 768px) {
  .lightbox-close {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    top: 10px;
    right: 10px;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-counter {
    bottom: 20px;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
  }
}
