@import './tokens.css';

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* Responsive container */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* ============================================
   HERO SECTION (v0-3d style)
   ============================================ */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--color-bg) 0%, var(--color-bg) 50%, var(--color-muted) 100%);
  z-index: 0;
}

[data-theme="dark"] .hero-section::before {
  background: linear-gradient(to bottom, var(--color-bg) 0%, var(--color-bg) 50%, rgba(38, 38, 38, 0.2) 100%);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-section::before {
    background: linear-gradient(to bottom, var(--color-bg) 0%, var(--color-bg) 50%, rgba(38, 38, 38, 0.2) 100%);
  }
}

.hero-content {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 4rem var(--container-padding);
  text-align: center;
}

.hero-badge {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-accent-light);
  border: 1px solid var(--color-accent-border);
  border-radius: 9999px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
}

.hero-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: 1.5rem;
  line-height: var(--line-height-tight);
  text-wrap: balance;
}

.hero-subtitle {
  font-size: clamp(1.125rem, 2.5vw, 1.25rem);
  color: var(--color-muted-foreground);
  max-width: 42rem;
  margin: 0 auto 2rem;
  line-height: var(--line-height-relaxed);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

@media (min-width: 640px) {
  .hero-actions {
    flex-direction: row;
  }
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent 0%, var(--color-border) 50%, transparent 100%);
}

@media (max-width: 767px) {
  .hero-section {
    min-height: 60vh;
  }
  
  .hero-content {
    padding: 3rem var(--container-padding);
  }
}

/* ============================================
   HEADER / NAVIGATION (v0-3d style)
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  height: 4rem;
  background: rgba(250, 250, 250, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition-base), border-color var(--transition-base);
}

[data-theme="dark"] .site-header {
  background: rgba(26, 26, 26, 0.8);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .site-header {
    background: rgba(26, 26, 26, 0.8);
  }
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  gap: var(--spacing-lg);
}

/* Brand/Logo */
.nav-brand {
  flex-shrink: 0;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-text);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.brand-link:hover {
  color: var(--color-accent);
  transform: translateY(-1px);
}

.brand-icon {
  width: 3rem;
  height: 3rem;
  display: block;
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.brand-link:hover .brand-icon {
  transform: rotate(5deg);
  filter: brightness(1.1);
}

.brand-name {
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
}

/* Navigation Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
  height: 100%;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--color-muted-foreground);
  text-decoration: none;
  padding: 0.5rem 1rem;
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  border-radius: var(--border-radius-md);
  transition: all var(--transition-base);
  white-space: nowrap;
  height: 100%;
}

.nav-link span {
  position: relative;
  z-index: 1;
}

.nav-link:hover {
  color: var(--color-text);
}

.nav-link.active {
  color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
}

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


/* ============================================
   BUTTONS (v0-3d style)
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  transition: all var(--transition-base);
  cursor: pointer;
  text-decoration: none;
  border: none;
  outline: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-primary-foreground);
  padding: 0.625rem 1.5rem;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  opacity: 0.9;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: var(--font-size-base);
}

.btn-outline {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: 0.625rem 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

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

[data-theme="dark"] .btn-outline {
  background: rgba(64, 64, 64, 0.3);
  border-color: var(--color-input);
}

[data-theme="dark"] .btn-outline:hover {
  background: rgba(64, 64, 64, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-outline {
    background: rgba(64, 64, 64, 0.3);
    border-color: var(--color-input);
  }
  
  :root:not([data-theme="light"]) .btn-outline:hover {
    background: rgba(64, 64, 64, 0.5);
  }
}

/* ============================================
   CARDS (v0-3d style)
   ============================================ */
.card {
  background: var(--color-card);
  color: var(--color-card-foreground);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--color-border);
  padding: 1.5rem;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.card:hover {
  border-color: var(--color-accent-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.card-description {
  color: var(--color-muted-foreground);
  font-size: var(--font-size-sm);
}

.card-content {
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
}

/* ============================================
   SECTIONS (v0-3d style)
   ============================================ */
.section {
  padding: 5rem 0;
}

.section-title {
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: var(--font-weight-bold);
  text-align: center;
  margin-bottom: 1rem;
}

.section-description {
  font-size: var(--font-size-lg);
  color: var(--color-muted-foreground);
  text-align: center;
  max-width: 42rem;
  margin: 0 auto 3rem;
  line-height: var(--line-height-relaxed);
}

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

[data-theme="dark"] .section-muted {
  background: rgba(38, 38, 38, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .section-muted {
    background: rgba(38, 38, 38, 0.3);
  }
}

/* ============================================
   STATS SECTION (v0-3d style)
   ============================================ */
.stats-section {
  padding: 5rem 0;
  background: var(--color-muted);
}

[data-theme="dark"] .stats-section {
  background: rgba(38, 38, 38, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stats-section {
    background: rgba(38, 38, 38, 0.3);
  }
}

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

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

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

.stat-value {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: var(--font-weight-bold);
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--color-muted-foreground);
}

/* ============================================
   SERVICES GRID (v0-3d style)
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

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

.service-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.service-card:hover {
  border-color: var(--color-accent-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.service-icon {
  width: 3rem;
  height: 3rem;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.5rem;
}

.service-card p {
  color: var(--color-muted-foreground);
  line-height: var(--line-height-relaxed);
}

/* ============================================
   CASE STUDIES / TESTIMONIALS (v0-3d style)
   ============================================ */
.cases-grid,
.testimonials-grid {
  column-count: 1;
  column-gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .cases-grid,
  .testimonials-grid {
    column-count: 2;
    column-gap: 1.5rem;
  }
}

.case-card,
.testimonial-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  display: flex;
  flex-direction: column;
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

.case-card:hover,
.testimonial-card:hover {
  border-color: var(--color-accent-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.case-card img,
.testimonial-card img {
  width: 100%;
  height: 20rem;
  object-fit: contain;
  flex-shrink: 0;
  background: var(--color-muted);
}

.case-card-content,
.testimonial-card-content {
  padding: 2rem;
  flex: 1;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--color-secondary);
  color: var(--color-secondary-foreground);
  border-radius: 9999px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  margin-bottom: 0.75rem;
}

.case-card h3,
.testimonial-card h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.5rem;
}

.case-card p,
.testimonial-card p {
  color: var(--color-muted-foreground);
  line-height: var(--line-height-relaxed);
}

/* ============================================
   CASE IMAGE CAROUSEL
   ============================================ */
.case-image-carousel {
  position: relative;
  width: 100%;
  height: 20rem;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--color-muted);
}

.case-image-carousel.has-blur-bg {
  background: transparent !important;
}

.case-image-carousel.has-blur-bg .carousel-container {
  background: transparent;
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(50px);
  opacity: 0.7;
  z-index: 0;
  display: none;
  pointer-events: none;
  transform: scale(1.1);
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  z-index: 1;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 2;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  pointer-events: none;
  position: relative;
  z-index: 1;
}

.case-image-carousel.has-blur-bg .carousel-slide img {
  background: transparent;
}

.carousel-controls {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.case-image-carousel:hover .carousel-controls {
  opacity: 1;
}

.carousel-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text);
  transition: background var(--transition-base), transform var(--transition-base);
  padding: 0;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.carousel-btn:active {
  transform: scale(0.95);
}

[data-theme="dark"] .carousel-btn {
  background: rgba(0, 0, 0, 0.7);
  color: var(--color-text);
  border-color: var(--color-border);
}

[data-theme="dark"] .carousel-btn:hover {
  background: rgba(0, 0, 0, 0.9);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .carousel-btn {
    background: rgba(0, 0, 0, 0.7);
    color: var(--color-text);
    border-color: var(--color-border);
  }

  :root:not([data-theme="light"]) .carousel-btn:hover {
    background: rgba(0, 0, 0, 0.9);
  }
}

.carousel-indicators {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.carousel-indicator {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition-base), transform var(--transition-base);
}

.carousel-indicator.active {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.2);
}

.carousel-indicator:hover {
  background: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .carousel-indicator {
  background: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .carousel-indicator.active {
  background: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .carousel-indicator:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* ============================================
   IMAGE LIGHTBOX MODAL
   ============================================ */
.image-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow: hidden;
}

.image-lightbox-background {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(60px) brightness(0.8);
  opacity: 1;
  z-index: 0;
  display: none;
  pointer-events: none;
}

.image-lightbox.has-blur-background {
  background: rgba(0, 0, 0, 0.3) !important;
}

.image-lightbox.has-blur-background .image-lightbox-background {
  display: block !important;
  z-index: 0 !important;
}

.image-lightbox.active {
  display: flex;
}

.image-lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  background: transparent;
}

.image-lightbox img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--border-radius-md);
}

.image-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text);
  transition: background var(--transition-base), transform var(--transition-base);
  z-index: 10000;
}

.image-lightbox-close:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.image-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  color: var(--color-text);
  transition: background var(--transition-base), transform var(--transition-base);
  z-index: 10000;
}

.image-lightbox-nav:hover {
  background: rgba(255, 255, 255, 1);
  transform: translateY(-50%) scale(1.1);
}

.image-lightbox-nav.prev {
  left: 1rem;
}

.image-lightbox-nav.next {
  right: 1rem;
}

.image-lightbox-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.image-lightbox-nav.prev:active {
  transform: translateY(-50%) scale(0.95);
}

[data-theme="dark"] .image-lightbox-close,
[data-theme="dark"] .image-lightbox-nav {
  background: rgba(0, 0, 0, 0.7);
  color: var(--color-text);
  border-color: var(--color-border);
}

[data-theme="dark"] .image-lightbox-close:hover,
[data-theme="dark"] .image-lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.9);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .carousel-indicator {
    background: rgba(255, 255, 255, 0.3);
  }

  :root:not([data-theme="light"]) .carousel-indicator.active {
    background: rgba(255, 255, 255, 0.8);
  }

  :root:not([data-theme="light"]) .carousel-indicator:hover {
    background: rgba(255, 255, 255, 0.5);
  }
}

/* ============================================
   CTA SECTION (v0-3d style)
   ============================================ */
.cta-section {
  padding: 5rem 0;
}

.cta-content {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

.cta-title {
  font-size: clamp(1.875rem, 5vw, 3rem);
  font-weight: var(--font-weight-bold);
  margin-bottom: 1rem;
  text-wrap: balance;
}

.cta-description {
  font-size: var(--font-size-lg);
  color: var(--color-muted-foreground);
  margin-bottom: 2rem;
  line-height: var(--line-height-relaxed);
}

/* ============================================
   FOOTER (v0-3d style)
   ============================================ */
footer {
  background: var(--color-muted);
  border-top: 1px solid var(--color-border);
  padding: 3rem var(--container-padding);
}

[data-theme="dark"] footer {
  background: rgba(38, 38, 38, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) footer {
    background: rgba(38, 38, 38, 0.3);
  }
}

.footer-content {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.footer-brand-icon {
  width: 3rem;
  height: 3rem;
  display: block;
}

.footer-brand-name {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
}

.footer-description {
  font-size: var(--font-size-sm);
  color: var(--color-muted-foreground);
  line-height: var(--line-height-relaxed);
}

.footer-section h3 {
  font-weight: var(--font-weight-semibold);
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-section ul li {
  font-size: var(--font-size-sm);
  color: var(--color-muted-foreground);
}

.footer-section ul li a {
  color: var(--color-muted-foreground);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-section ul li a:hover {
  color: var(--color-text);
}

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.footer-social a {
  color: var(--color-muted-foreground);
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
  padding-top: 2rem;
  text-align: center;
  font-size: var(--font-size-sm);
  color: var(--color-muted-foreground);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  background-color: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  font-size: var(--font-size-base);
  transition: border-color var(--transition-base), background-color var(--transition-base);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
  border-color: var(--color-accent);
  background-color: var(--color-bg);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder,
textarea::placeholder {
  color: var(--color-muted-foreground);
  opacity: 0.7;
}

input[type="checkbox"] {
  accent-color: var(--color-accent);
}

label {
  color: var(--color-text);
  font-weight: var(--font-weight-medium);
  margin-bottom: 0.5rem;
  display: block;
}

/* ============================================
   LANGUAGE SWITCHER & THEME TOGGLE
   ============================================ */
.language-switcher {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  background: var(--color-bg-alt);
  border-radius: var(--border-radius-lg);
  padding: 0.25rem;
  gap: 0;
  position: relative;
  border: 1px solid var(--color-border);
  transition: background var(--transition-base), border-color var(--transition-base);
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem 0.75rem;
  min-width: 44px;
  min-height: 44px;
  text-decoration: none;
  color: var(--color-muted-foreground);
  background: transparent;
  border: none;
  border-radius: var(--border-radius-md);
  transition: all var(--transition-base);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.lang-label {
  display: inline-block;
  line-height: 1;
}

.lang-toggle:hover {
  color: var(--color-text);
}

.lang-toggle.active {
  background: var(--color-bg);
  color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .lang-toggle.active {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lang-toggle.active {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}

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

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.375rem;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius-md);
  color: var(--color-muted-foreground);
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  transition: all var(--transition-base);
  margin-right: 0.5rem;
}

.theme-toggle:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.theme-toggle:active {
  transform: scale(0.95);
}

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

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
  padding-top: 4rem;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
  text-align: center;
}

.text-balance {
  text-wrap: balance;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mt-8 {
  margin-top: 2rem;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */
@media (max-width: 767px) {
  :root {
    --container-padding: var(--spacing-md);
    --header-height: auto;
    --font-size-base: 0.9375rem; /* 15px for better mobile readability */
  }

  html {
    font-size: 15px;
  }

  body {
    font-size: var(--font-size-base);
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  .section {
    padding: 2.5rem 0;
  }

  .section-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
    margin-bottom: 0.75rem;
  }

  .section-description {
    font-size: var(--font-size-base);
    margin-bottom: 2rem;
  }

  /* Hero adjustments */
  .hero-section {
    min-height: 50vh;
  }

  .hero-content {
    padding: 2rem var(--spacing-md);
  }

  .hero-title {
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: var(--font-size-base);
    margin-bottom: 1.5rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  /* Grid adjustments */
  .services-grid,
  .testimonials-grid,
  .cases-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

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

  /* Form adjustments */
  form div[style*="grid-template-columns: 1fr 1fr"],
  form div[style*="grid-template-columns: 2fr 1fr"],
  .form-row-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .form-row-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  /* Cards */
  .card,
  .service-card,
  .case-card,
  .testimonial-card {
    padding: 1rem;
  }

  .case-card img,
  .testimonial-card img {
    height: 15rem;
  }

  .case-card-content,
  .testimonial-card-content {
    padding: 1.5rem;
  }

  /* Footer */
  footer {
    padding: 2rem var(--spacing-md);
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-section {
    margin-bottom: 1rem;
  }

  /* Buttons */
  .btn {
    width: 100%;
    padding: 0.75rem 1.25rem;
    font-size: var(--font-size-base);
  }

  .btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: var(--font-size-base);
  }

  /* Navigation */
  .site-header {
    height: auto;
    min-height: 3.5rem;
  }

  .main-nav {
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    align-items: center;
    justify-content: flex-start !important; /* Override desktop space-between */
  }

  /* First row: brand + controls */
  .nav-brand {
    order: 1;
    flex-shrink: 0;
    flex: 0 0 auto;
  }

  .brand-link {
    font-size: var(--font-size-lg);
    gap: 0.375rem;
  }

  .brand-icon {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
  }

  .brand-name {
    display: none; /* Hide brand name on very small screens */
  }

  /* Controls wrapper for theme toggle and language switcher */
  .theme-toggle {
    order: 2;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0.25rem !important;
    font-size: 0.875rem !important;
    flex-shrink: 0;
    margin-left: auto !important; /* Push theme toggle and language switcher to the right */
    margin-right: 0 !important;
  }

  .language-switcher {
    order: 3;
    flex-shrink: 0;
    margin-left: 0.375rem !important; /* Override desktop margin-left: auto */
    margin-right: 0;
    padding: 0.125rem !important;
    border-radius: var(--border-radius-md) !important;
  }

  .nav-links {
    order: 4;
    width: 100%;
    flex: none !important; /* Override desktop flex: 1 */
    justify-content: flex-start !important; /* Override desktop center */
    overflow-x: auto;
    padding: var(--spacing-xs) 0;
    gap: var(--spacing-xs);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-top: 0.5rem;
    height: auto;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex-shrink: 0;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--font-size-sm);
    white-space: nowrap;
    height: auto;
  }

  .lang-toggle {
    min-width: 36px !important;
    min-height: 36px !important;
    font-size: var(--font-size-xs) !important;
    padding: 0.25rem 0.5rem !important;
  }

  /* Main content padding - adjust based on header height */
  /* Header has min-height 3.5rem + nav-links row (~2.5rem) = ~6rem total */
  .main-content {
    padding-top: 6rem !important;
  }

  /* Images */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Responsive images with fixed heights */
  img[style*="height: 400px"],
  img[style*="height: 250px"],
  img[style*="height: 200px"] {
    height: auto !important;
    max-height: 300px;
    object-fit: cover;
  }

  /* Article content */
  article {
    padding: 1.5rem 0 !important;
  }

  article[style*="max-width: 800px"] {
    max-width: 100% !important;
    padding: 1.5rem 0 !important;
  }

  /* Section padding adjustments */
  section[style*="padding: 4rem"],
  section[style*="padding: 3rem"] {
    padding: 2rem 0 !important;
  }

  /* Hero section padding */
  .hero-section[style*="min-height: 30vh"],
  .hero-section[style*="min-height: 40vh"] {
    min-height: 40vh !important;
    padding-top: 1rem !important;
  }

  /* Text adjustments */
  .card-title,
  .service-card h3,
  .case-card h3,
  .testimonial-card h3 {
    font-size: var(--font-size-lg);
  }

  .card-description,
  .service-card p,
  .case-card p,
  .testimonial-card p {
    font-size: var(--font-size-sm);
  }

  /* CTA section */
  .cta-section {
    padding: 3rem 0;
  }

  .cta-title {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .cta-description {
    font-size: var(--font-size-base);
  }

  /* Contact form specific */
  .contact-info-card {
    padding: 1.5rem !important;
  }
}

@media (min-width: 768px) {
  .form-row-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .brand-name {
    display: inline; /* Show brand name on slightly larger mobile screens */
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  :root {
    --container-padding: var(--spacing-lg);
  }

  .services-grid,
  .testimonials-grid,
  .cases-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem;
  }

  .section {
    padding: 4rem 0;
  }

  .hero-content {
    padding: 3.5rem var(--spacing-lg);
  }
}

@media (min-width: 1024px) {
  :root {
    --container-padding: var(--spacing-xl);
  }

  .cases-grid,
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    grid-auto-rows: min-content;
    grid-auto-flow: dense;
  }

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

  .btn {
    width: auto;
  }
}

/* ============================================
   DARK MODE OVERRIDES
   ============================================ */
[data-theme="dark"] {
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  }
}

[data-theme="dark"] img {
  opacity: 0.95;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) img {
    opacity: 0.95;
  }
}
