/* Material Design 3 Theme & Utilities for Covenant Architect Solutions */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap');

:root {
  /* White & Professional Blue Theme */
  --md-sys-color-primary: #0f52ba; /* Professional Sapphire Blue */
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #e0ebff;
  --md-sys-color-on-primary-container: #001a41;
  
  --md-sys-color-secondary: #007a87; /* Professional Teal/Blue secondary */
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #c4f2f7;
  --md-sys-color-on-secondary-container: #002025;

  --md-sys-color-surface: #ffffff; /* Clean white */
  --md-sys-color-on-surface: #1c1b1f;
  --md-sys-color-surface-variant: #f0f4f8; /* Soft light gray-blue variant */
  --md-sys-color-on-surface-variant: #43474e;
  --md-sys-color-outline: #73777f;

  --md-sys-color-background: #fbfcfe; /* Clean off-white background */
  --md-sys-color-on-background: #1c1b1f;
  
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;

  /* Elevation / Shadows (optimized for light theme) */
  --md-elevation-1: 0px 1px 3px 1px rgba(0, 0, 0, 0.08), 0px 1px 2px 0px rgba(0, 0, 0, 0.12);
  --md-elevation-2: 0px 2px 6px 2px rgba(0, 0, 0, 0.08), 0px 1px 2px 0px rgba(0, 0, 0, 0.12);
  --md-elevation-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.08), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
  --md-elevation-4: 0px 6px 10px 4px rgba(0, 0, 0, 0.08), 0px 2px 3px 0px rgba(0, 0, 0, 0.12);

  /* Fonts */
  --md-ref-typeface-brand: 'Outfit', sans-serif;
  --md-ref-typeface-plain: 'Roboto', sans-serif;

  /* Border Radii */
  --md-shape-corner-none: 0px;
  --md-shape-corner-extra-small: 4px;
  --md-shape-corner-small: 8px;
  --md-shape-corner-medium: 12px;
  --md-shape-corner-large: 16px;
  --md-shape-corner-extra-large: 28px;
  --md-shape-corner-full: 9999px;
  
  /* Transitions */
  --md-transition-duration: 0.2s;
  --md-transition-easing: cubic-bezier(0.2, 0, 0, 1);
}

/* Force Light Theme with Professional Blue and White */
.theme-dark {
  --md-sys-color-primary: #0f52ba;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #e0ebff;
  --md-sys-color-on-primary-container: #001a41;
  
  --md-sys-color-secondary: #007a87;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #c4f2f7;
  --md-sys-color-on-secondary-container: #002025;

  --md-sys-color-surface: #ffffff;
  --md-sys-color-on-surface: #1c1b1f;
  --md-sys-color-surface-variant: #f0f4f8;
  --md-sys-color-on-surface-variant: #43474e;
  --md-sys-color-outline: #73777f;

  --md-sys-color-background: #fbfcfe;
  --md-sys-color-on-background: #1c1b1f;
  
  --md-sys-color-error: #ba1a1a;
  --md-sys-color-on-error: #ffffff;
}


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

@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: page-fade-out 160ms ease both;
}

::view-transition-new(root) {
  animation: page-fade-in 220ms ease both;
}

@keyframes page-fade-out {
  to {
    opacity: 0;
  }
}

@keyframes page-fade-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 1ms;
  }
}

body {
  font-family: var(--md-ref-typeface-plain);
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  line-height: 1.6;
  transition: background-color var(--md-transition-duration) var(--md-transition-easing),
              color var(--md-transition-duration) var(--md-transition-easing);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--md-ref-typeface-brand);
  font-weight: 600;
  color: var(--md-sys-color-on-background);
}

a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
  transition: color var(--md-transition-duration) ease;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  font-size: 2.5rem;
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: var(--md-sys-color-primary);
  border-radius: var(--md-shape-corner-full);
}

.section-title p {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 1.1rem;
}

/* Header & Nav */
.header-m3 {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--md-sys-color-background);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(28, 27, 31, 0.08);
  transition: all var(--md-transition-duration) ease;
}

.header-m3 .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 72px;
  position: relative;
}

.logo-m3 {
  font-family: var(--md-ref-typeface-brand);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--md-sys-color-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-m3 span {
  color: var(--md-sys-color-on-background);
}

.nav-m3 ul {
  display: flex;
  list-style: none;
  gap: 24px;
  align-items: center;
}

.nav-m3 a {
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--md-shape-corner-full);
  transition: all var(--md-transition-duration) ease;
}

.nav-m3 a:hover, .nav-m3 a.active {
  color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-primary-container);
}

/* Material 3 Buttons */
.md-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--md-ref-typeface-plain);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--md-shape-corner-full);
  border: none;
  cursor: pointer;
  gap: 8px;
  transition: box-shadow var(--md-transition-duration) var(--md-transition-easing),
              background-color var(--md-transition-duration) var(--md-transition-easing),
              color var(--md-transition-duration) var(--md-transition-easing);
  position: relative;
  overflow: hidden;
}

.md-btn-filled {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.md-btn-filled:hover {
  background-color: #acc1ff; /* slightly lighter for dark theme hover */
  box-shadow: var(--md-elevation-1);
}

.md-btn-tonal {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.md-btn-tonal:hover {
  box-shadow: var(--md-elevation-1);
}

.md-btn-outlined {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline);
}

.md-btn-outlined:hover {
  background-color: rgba(179, 197, 255, 0.08);
}

.md-btn-text {
  background-color: transparent;
  color: var(--md-sys-color-primary);
  padding: 12px 16px;
}

.md-btn-text:hover {
  background-color: rgba(179, 197, 255, 0.08);
}

/* Material 3 Cards */
.md-card {
  background-color: var(--md-sys-color-surface);
  border-radius: var(--md-shape-corner-large);
  padding: 24px;
  transition: box-shadow var(--md-transition-duration) var(--md-transition-easing),
              background-color var(--md-transition-duration) var(--md-transition-easing),
              transform var(--md-transition-duration) var(--md-transition-easing);
  display: flex;
  flex-direction: column;
}

.md-card-elevated {
  box-shadow: var(--md-elevation-1);
}

.md-card-elevated:hover {
  box-shadow: var(--md-elevation-3);
  transform: translateY(-4px);
}

.md-card-outlined {
  border: 1px solid var(--md-sys-color-outline);
}

.md-card-outlined:hover {
  box-shadow: var(--md-elevation-2);
  transform: translateY(-4px);
}

.md-card-filled {
  background-color: var(--md-sys-color-surface-variant);
}

.md-card-filled:hover {
  box-shadow: var(--md-elevation-1);
  transform: translateY(-4px);
}

/* Hero Section */
.hero-m3 {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 85vh;
  overflow: hidden;
  background-color: var(--md-sys-color-background);
}

.hero-m3 .row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
}

.hero-text {
  flex: 1 1 500px;
}

.hero-text h1 {
  font-size: 3.5rem;
  line-height: 1.15;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  font-size: 1.25rem;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.hero-img-container {
  flex: 1 1 400px;
  display: flex;
  justify-content: center;
}

.hero-img-container img {
  max-width: 100%;
  height: auto;
  border-radius: var(--md-shape-corner-extra-large);
  box-shadow: var(--md-elevation-4);
  animation: floatAnim 6s ease-in-out infinite;
}

@keyframes floatAnim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* Services Grid */
.grid-services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.service-card .icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--md-shape-corner-medium);
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

.service-card h3 {
  font-size: 1.35rem;
  margin-bottom: 12px;
}

.service-card p {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.95rem;
}

/* Portfolio Grid */
.portfolio-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 36px;
}

.md-chip {
  padding: 8px 16px;
  border-radius: var(--md-shape-corner-small);
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--md-transition-duration) ease;
  font-size: 0.9rem;
}

.md-chip:hover {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}

.md-chip.active {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.grid-portfolio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 32px;
}

.portfolio-card {
  padding: 0;
  overflow: hidden;
}

.portfolio-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 1px solid var(--md-sys-color-outline);
}

.portfolio-info-m3 {
  padding: 24px;
}

.portfolio-info-m3 h4 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.portfolio-info-m3 p {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

/* FAQ Accordion */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-card {
  cursor: pointer;
}

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

.faq-header h3 {
  font-size: 1.15rem;
  font-weight: 500;
}

.faq-icon-arrow {
  transition: transform var(--md-transition-duration) ease;
}

.faq-card.active .faq-icon-arrow {
  transform: rotate(180deg);
}

.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--md-transition-duration) ease, padding var(--md-transition-duration) ease;
  padding: 0;
}

.faq-card.active .faq-body {
  max-height: 200px;
  padding-top: 16px;
}

.faq-body p {
  color: var(--md-sys-color-on-surface-variant);
}

/* Contact Form Fields */
.contact-section-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 40px;
}

.info-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.info-card-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-card-item i {
  font-size: 1.5rem;
  color: var(--md-sys-color-primary);
}

.info-card-item h4 {
  font-size: 1rem;
}

.info-card-item p {
  font-size: 0.9rem;
  color: var(--md-sys-color-on-surface-variant);
}

.md-form-field {
  margin-bottom: 20px;
  position: relative;
}

.md-input, .md-textarea {
  width: 100%;
  padding: 16px;
  background-color: var(--md-sys-color-surface-variant);
  border: 1px solid transparent;
  border-bottom: 2px solid var(--md-sys-color-outline);
  border-radius: var(--md-shape-corner-extra-small) var(--md-shape-corner-extra-small) 0px 0px;
  color: var(--md-sys-color-on-surface);
  font-family: var(--md-ref-typeface-plain);
  font-size: 1rem;
  transition: all var(--md-transition-duration) ease;
}

.md-input:focus, .md-textarea:focus {
  outline: none;
  border-bottom-color: var(--md-sys-color-primary);
  background-color: rgba(255, 255, 255, 0.03);
}

.md-form-field label {
  position: absolute;
  left: 16px;
  top: 16px;
  color: var(--md-sys-color-on-surface-variant);
  transition: all var(--md-transition-duration) ease;
  pointer-events: none;
  font-size: 1rem;
}

.md-input:focus ~ label,
.md-input:not(:placeholder-shown) ~ label,
.md-textarea:focus ~ label,
.md-textarea:not(:placeholder-shown) ~ label {
  top: 4px;
  font-size: 0.75rem;
  color: var(--md-sys-color-primary);
}

.md-input::placeholder, .md-textarea::placeholder {
  color: transparent;
}

/* Footer */
.footer-m3 {
  background-color: var(--md-sys-color-surface);
  padding: 48px 0 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: var(--md-sys-color-primary);
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col a {
  color: var(--md-sys-color-on-surface-variant);
}

.footer-col a:hover {
  color: var(--md-sys-color-primary);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-bottom p {
  color: var(--md-sys-color-on-surface-variant);
  font-size: 0.9rem;
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: var(--md-shape-corner-full);
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--md-transition-duration) ease;
}

.social-links a:hover {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

/* Mobile Nav Styles */
.mobile-nav-toggle {
  display: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--md-sys-color-on-background);
}

/* Responsive Overrides */
@media (max-width: 768px) {
  .logo-m3 {
    font-size: 1.1rem;
    gap: 4px;
  }
  .nav-m3 {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    width: 100%;
    background-color: var(--md-sys-color-surface);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    border-bottom-left-radius: var(--md-shape-corner-large);
    border-bottom-right-radius: var(--md-shape-corner-large);
    padding: 16px 20px 24px 20px;
    border-top: 1px solid rgba(28, 27, 31, 0.08);
    z-index: 999;
  }
  .nav-m3.active {
    display: block !important;
  }
  .nav-m3 ul {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }
  .nav-m3 a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-size: 1rem;
    width: 100%;
    border-radius: var(--md-shape-corner-full);
  }
  .mobile-nav-toggle {
    display: block;
    user-select: none;
  }
  .hero-text h1 {
    font-size: 2.5rem;
  }
  .info-cards {
    grid-template-columns: 1fr;
  }
}
