/* ============================================
   Crimson Fire Architecture Studio Theme
   Modern, Responsive Design System
   ============================================ */

/* ============================================
   CSS Variables & Design Tokens
   ============================================ */
:root {
  --primary-color: #DC143C;
  --primary-dark: #B01030;
  --primary-light: #E84560;
  --secondary-color: #FF4500;
  --secondary-dark: #CC3700;
  --secondary-light: #FF6A33;
  
  --neutral-100: #FFFFFF;
  --neutral-200: #F8F9FA;
  --neutral-300: #E9ECEF;
  --neutral-400: #DEE2E6;
  --neutral-500: #ADB5BD;
  --neutral-600: #6C757D;
  --neutral-700: #495057;
  --neutral-800: #343A40;
  --neutral-900: #212529;
  
  --text-primary: #212529;
  --text-secondary: #6C757D;
  --text-light: #FFFFFF;
  
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Montserrat', 'Inter', sans-serif;
  
  --transition-fast: 0.2s ease-in-out;
  --transition-base: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
  
  --shadow-sm: 0 2px 4px rgba(220, 20, 60, 0.08);
  --shadow-md: 0 4px 12px rgba(220, 20, 60, 0.12);
  --shadow-lg: 0 8px 24px rgba(220, 20, 60, 0.16);
  --shadow-xl: 0 16px 48px rgba(220, 20, 60, 0.2);
  
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2.5rem;
  --spacing-xl: 4rem;
}

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

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

body {
  font-family: var(--font-primary);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--neutral-100);
  overflow-x: hidden;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

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, 2rem);
}

h4 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

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

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

a:hover {
  color: var(--primary-dark);
}

/* ============================================
   Bootstrap 5 Overrides
   ============================================ */
.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  padding: 0.875rem 2rem;
  border-radius: var(--border-radius-md);
  border: 2px solid transparent;
  transition: all var(--transition-base);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow);
  z-index: -1;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--neutral-100);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  color: var(--neutral-100);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(0);
}

.btn-secondary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: var(--neutral-100);
}

.btn-secondary:hover,
.btn-secondary:focus {
  background-color: var(--secondary-dark);
  border-color: var(--secondary-dark);
  color: var(--neutral-100);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--neutral-100);
  transform: translateY(-2px);
}

.btn-outline-light {
  background-color: transparent;
  border-color: var(--neutral-100);
  color: var(--neutral-100);
}

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

.btn-lg {
  padding: 1.125rem 2.5rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.625rem 1.5rem;
  font-size: 0.75rem;
}

/* Card Overrides */
.card {
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-img-top {
  transition: transform var(--transition-slow);
}

.card:hover .card-img-top {
  transform: scale(1.05);
}

/* Form Overrides */
.form-control,
.form-select {
  border: 2px solid var(--neutral-300);
  border-radius: var(--border-radius-md);
  padding: 0.875rem 1rem;
  font-size: 1rem;
  transition: all var(--transition-fast);
  background-color: var(--neutral-100);
  color: var(--text-primary);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(220, 20, 60, 0.15);
  outline: none;
}

.form-control::placeholder {
  color: var(--neutral-500);
}

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

.invalid-feedback {
  color: var(--primary-color);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-control.is-invalid {
  border-color: var(--primary-color);
}

.form-control.is-valid {
  border-color: #28a745;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
  padding: 1.5rem 0;
  transition: all var(--transition-base);
  background-color: transparent;
}

.navbar.scrolled {
  padding: 1rem 0;
  background-color: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.navbar-brand {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -0.02em;
  transition: all var(--transition-fast);
}

.navbar-brand:hover {
  color: var(--primary-dark);
  transform: scale(1.05);
}

.navbar-nav .nav-link {
  font-weight: 600;
  color: var(--text-primary);
  padding: 0.5rem 1.25rem;
  margin: 0 0.25rem;
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
  position: relative;
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0.25rem;
  left: 1.25rem;
  right: 1.25rem;
  height: 2px;
  background-color: var(--primary-color);
  transform: scaleX(0);
  transition: transform var(--transition-base);
}

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

.navbar-nav .nav-link:hover::after {
  transform: scaleX(1);
}

.navbar-nav .nav-link.active {
  color: var(--primary-color);
}

.navbar-nav .nav-link.active::after {
  transform: scaleX(1);
}

.navbar-toggler {
  border: 2px solid var(--primary-color);
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-md);
  transition: all var(--transition-fast);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(220, 20, 60, 0.25);
  outline: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(220, 20, 60, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================
   Hero Section
   ============================================ */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background: linear-gradient(135deg, rgba(220, 20, 60, 0.95) 0%, rgba(255, 69, 0, 0.9) 100%);
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('data:image/svg+xml,%3Csvg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"%3E%3Cg fill="none" fill-rule="evenodd"%3E%3Cg fill="%23ffffff" fill-opacity="0.05"%3E%3Cpath d="M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
  opacity: 0.3;
  animation: patternMove 60s linear infinite;
}

@keyframes patternMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(60px, 60px);
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--neutral-100);
}

.hero-section h1 {
  color: var(--neutral-100);
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.8s ease-out;
}

.hero-section p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.25rem;
  max-width: 600px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-buttons {
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* ============================================
   Section Styles
   ============================================ */
section {
  padding: var(--spacing-xl) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  position: relative;
}

.section-title {
  position: relative;
  display: inline-block;
  padding-bottom: 1rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-top: 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================
   Portfolio/Projects Grid
   ============================================ */
.project-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  height: 400px;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(220, 20, 60, 0.95) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  transform: translateY(100%);
  transition: transform var(--transition-base);
}

.project-card:hover .project-overlay {
  transform: translateY(0);
}

.project-card:hover .project-image {
  transform: scale(1.1);
}

.project-title {
  color: var(--neutral-100);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.project-category {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.project-description {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============================================
   Services Section
   ============================================ */
.service-item {
  padding: 2.5rem;
  border-radius: var(--border-radius-lg);
  background-color: var(--neutral-100);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  height: 100%;
  border: 2px solid transparent;
}

.service-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.service-icon {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--neutral-100);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  transition: transform var(--transition-base);
}

.service-item:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
}

.service-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.service-description {
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ============================================
   Testimonials
   ============================================ */
.testimonial-card {
  background-color: var(--neutral-100);
  padding: 2.5rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  position: relative;
  height: 100%;
  transition: all var(--transition-base);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.testimonial-quote {
  font-size: 3rem;
  color: var(--primary-color);
  opacity: 0.2;
  position: absolute;
  top: 1.5rem;
  left: 2rem;
  line-height: 1;
}

.testimonial-text {
  font-size: 1.125rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonial-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-color);
}

.testimonial-info h5 {
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.testimonial-role {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ============================================
   Contact Form
   ============================================ */
.contact-section {
  background: linear-gradient(135deg, rgba(220, 20, 60, 0.05) 0%, rgba(255, 69, 0, 0.05) 100%);
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.5rem;
  background-color: var(--neutral-100);
  border-radius: var(--border-radius-lg);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.contact-info-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(8px);
}

.contact-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--neutral-100);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.contact-info-content h5 {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.contact-info-content p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.contact-info-content a {
  color: var(--primary-color);
  font-weight: 600;
}

.contact-info-content a:hover {
  color: var(--primary-dark);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: linear-gradient(135deg, var(--neutral-900) 0%, var(--neutral-800) 100%);
  color: var(--neutral-300);
  padding: var(--spacing-xl) 0 var(--spacing-md);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.footer h5 {
  color: var(--neutral-100);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.footer h5::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--primary-color);
}

.footer p {
  color: var(--neutral-400);
  line-height: 1.8;
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--neutral-400);
  transition: all var(--transition-fast);
  display: inline-block;
}

.footer-links a:hover {
  color: var(--primary-color);
  transform: translateX(5px);
}

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

.social-link {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-md);
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--neutral-100);
  transition: all var(--transition-base);
  font-size: 1.25rem;
}

.social-link:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--neutral-100);
  transform: translateY(-4px);
}

.footer-bottom {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.footer-bottom p {
  margin-bottom: 0;
  color: var(--neutral-500);
}

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

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

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

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

.animate-slide-in-right {
  animation: slideInRight 0.8s ease-out;
}

/* ============================================
   Utility Classes
   ============================================ */
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.text-primary-custom {
  color: var(--primary-color);
}

.text-secondary-custom {
  color: var(--secondary-color);
}

.border-primary-custom {
  border-color: var(--primary-color);
}

.overlay-dark {
  position: relative;
}

.overlay-dark::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

.overlay-dark > * {
  position: relative;
  z-index: 2;
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--neutral-300);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Back to Top Button
   ============================================ */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: var(--neutral-100);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* ============================================
   Responsive Design - Tablet
   ============================================ */
@media (max-width: 991px) {
  :root {
    --spacing-xl: 3rem;
    --spacing-lg: 2rem;
  }
  
  .navbar-collapse {
    background-color: var(--neutral-100);
    padding: 1.5rem;
    margin-top: 1rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
  }
  
  .navbar-nav .nav-link {
    padding: 0.75rem 1rem;
  }
  
  .navbar-nav .nav-link::after {
    display: none;
  }
  
  .hero-section {
    min-height: 80vh;
  }
  
  .project-card {
    height: 350px;
  }
}

/* ============================================
   Responsive Design - Mobile
   ============================================ */
@media (max-width: 767px) {
  :root {
    --spacing-xl: 2.5rem;
    --spacing-lg: 1.5rem;
    --spacing-md: 1rem;
  }
  
  .btn {
    padding: 0.75rem 1.5rem;
    width: 100%;
  }
  
  .btn-lg {
    padding: 0.875rem 2rem;
  }
  
  section {
    padding: var(--spacing-lg) 0;
  }
  
  .hero-section {
    min-height: 70vh;
    padding: 2rem 0;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .hero-section p {
    font-size: 1rem;
  }
  
  .section-title {
    font-size: 1.75rem;
  }
  
  .project-card {
    height: 300px;
    margin-bottom: 1.5rem;
  }
  
  .service-item {
    padding: 2rem;
    margin-bottom: 1.5rem;
  }
  
  .testimonial-card {
    padding: 2rem;
    margin-bottom: 1.5rem;
  }
  
  .contact-info-item {
    padding: 1.25rem;
  }
  
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }
  
  .footer h5 {
    margin-top: 2rem;
  }
  
  .footer h5:first-child {
    margin-top: 0;
  }
}

@media (max-width: 575px) {
  html {
    font-size: 14px;
  }
  
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .hero-buttons .btn {
    margin-bottom: 1rem;
  }
  
  .social-links {
    justify-content: center;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .navbar,
  .back-to-top,
  .hero-buttons,
  footer {
    display: none;
  }
  
  body {
    font-size: 12pt;
    color: #000;
  }
  
  a {
    text-decoration: underline;
  }
}