/* Cosmic Slate Architecture Studio Theme */
/* CSS Custom Properties */
:root {
  --primary-color: #2C3E50;
  --secondary-color: #E74C3C;
  --primary-light: #34495E;
  --primary-dark: #1A252F;
  --secondary-light: #EC7063;
  --secondary-dark: #C0392B;
  --text-light: #FFFFFF;
  --text-dark: #2C3E50;
  --text-muted: #6C757D;
  --bg-light: #F8F9FA;
  --bg-dark: #212529;
  --border-color: #DEE2E6;
  --shadow-light: rgba(44, 62, 80, 0.1);
  --shadow-medium: rgba(44, 62, 80, 0.2);
  --shadow-heavy: rgba(44, 62, 80, 0.3);
  --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  --gradient-secondary: linear-gradient(135deg, var(--secondary-color), var(--secondary-light));
  --gradient-cosmic: linear-gradient(135deg, #2C3E50 0%, #3498DB 50%, #9B59B6 100%);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-light);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

p {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--secondary-dark);
  text-decoration: none;
}

/* Bootstrap 5 Overrides */
.btn {
  border-radius: 0.5rem;
  padding: 0.75rem 2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-light);
  box-shadow: 0 4px 15px var(--shadow-light);
}

.btn-primary:hover {
  background: var(--gradient-primary);
  color: var(--text-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--shadow-medium);
}

.btn-secondary {
  background: var(--gradient-secondary);
  color: var(--text-light);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.2);
}

.btn-secondary:hover {
  background: var(--gradient-secondary);
  color: var(--text-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

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

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: var(--text-light);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 4px 20px var(--shadow-light);
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px var(--shadow-medium);
}

.form-control {
  border: 2px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.2rem rgba(231, 76, 60, 0.25);
}

/* Navbar Styles */
.navbar {
  background: rgba(44, 62, 80, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.scrolled {
  background: rgba(44, 62, 80, 0.98);
  box-shadow: 0 2px 20px var(--shadow-medium);
}

.navbar-brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-light);
  letter-spacing: -0.01em;
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
  margin: 0 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
  position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--text-light);
  background: rgba(231, 76, 60, 0.1);
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--secondary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

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

/* Hero Section */
.hero {
  min-height: 100vh;
  background: var(--gradient-cosmic);
  position: relative;
  display: flex;
  align-items: center;
  color: var(--text-light);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>')
  opacity: 0.3;
  animation: float 20s ease-in-out infinite;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero h1 {
  color: var(--text-light);
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out;
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero .btn {
  animation: fadeInUp 1s ease-out 0.4s both;
}

/* Cosmic Elements */
.cosmic-bg {
  background: var(--gradient-cosmic);
  position: relative;
  overflow: hidden;
}

.cosmic-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: rotate 100s linear infinite;
}

/* Section Styles */
.section {
  padding: 5rem 0;
  position: relative;
}

.section-dark {
  background: var(--primary-color);
  color: var(--text-light);
}

.section-dark h2,
.section-dark h3 {
  color: var(--text-light);
}

.section-dark p {
  color: rgba(255, 255, 255, 0.8);
}

/* Portfolio Grid */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.portfolio-item {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--gradient-primary);
  cursor: pointer;
  transition: all 0.3s ease;
}

.portfolio-item:hover {
  transform: scale(1.02);
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: var(--text-light);
  transition: all 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
  opacity: 0.9;
}

.portfolio-item:hover img {
  transform: scale(1.1);
}

/* Services Grid */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.service-card {
  padding: 2.5rem;
  background: var(--text-light);
  border-radius: 1rem;
  text-align: center;
  position: relative;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-secondary);
  border-radius: 1rem 1rem 0 0;
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

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

.service-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-light);
  transition: all 0.3s ease;
}

.service-card:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
  background: var(--gradient-secondary);
}

/* Contact Form */
.contact-form {
  background: var(--text-light);
  padding: 3rem;
  border-radius: 1rem;
  box-shadow: 0 10px 40px var(--shadow-light);
}

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

.form-label {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  display: block;
}

/* Footer */
.footer {
  background: var(--primary-dark);
  color: var(--text-light);
  padding: 3rem 0 1rem;
}

.footer h5 {
  color: var(--text-light);
  margin-bottom: 1rem;
}

.footer p,
.footer li {
  color: rgba(255, 255, 255, 0.8);
}

.footer a {
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
}

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

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

@keyframes float {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Loading Animation */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  .section {
    padding: 3rem 0;
  }
  
  .hero {
    min-height: 80vh;
    text-align: center;
  }
  
  .portfolio-grid,
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .contact-form {
    padding: 2rem;
  }
  
  .navbar-nav {
    background: rgba(44, 62, 80, 0.95);
    border-radius: 0.5rem;
    margin-top: 1rem;
    padding: 1rem;
  }
  
  .service-card {
    padding: 2rem;
  }
}

@media (max-width: 576px) {
  .portfolio-grid,
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .portfolio-item {
    min-height: 250px;
  }
  
  .btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .contact-form {
    padding: 1.5rem;
  }
}

/* Utility Classes */
.text-gradient {
  background: var(--gradient-secondary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-cosmic {
  background: var(--gradient-cosmic);
}

.shadow-cosmic {
  box-shadow: 0 10px 40px var(--shadow-medium);
}

.border-cosmic {
  border: 2px solid var(--secondary-color);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
  }
}

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