/* ============================================================
   Caprille Innovative Developments — Main Stylesheet
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors — dark professional palette inspired by the existing site */
  --color-primary: #1a3a2a;       /* Deep forest green */
  --color-primary-light: #2d5c42; /* Lighter green for hover */
  --color-accent: #c8a45c;        /* Warm gold accent */
  --color-accent-light: #dbb96e;
  --color-dark: #1a1a1a;
  --color-dark-soft: #2a2a2a;
  --color-text: #333333;
  --color-text-muted: #6b6b6b;
  --color-text-light: #ffffff;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f7f4;
  --color-bg-dark: #1a1a1a;
  --color-border: #e5e5e5;

  /* Typography */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --section-padding: 6rem 0;
  --container-max: 1200px;
  --container-padding: 1.5rem;

  /* Transitions */
  --transition: 0.3s ease;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

ul {
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-dark);
}

/* ---------- Utilities ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3.5rem;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--color-text-muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 2rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-light);
  border-color: var(--color-primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-primary-light);
  border-color: var(--color-primary-light);
}

.btn-outline {
  background: transparent;
  color: var(--color-text-light);
  border-color: var(--color-text-light);
}

.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--color-text-light);
  color: var(--color-primary);
}

.btn-nav {
  padding: 0.6rem 1.5rem;
  background: var(--color-accent);
  color: var(--color-dark);
  border-color: var(--color-accent);
  font-weight: 600;
}

.btn-nav:hover,
.btn-nav:focus-visible {
  background: var(--color-accent-light);
  border-color: var(--color-accent-light);
}

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background var(--transition);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo img {
  height: 40px;
  width: auto;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--color-text-light);
  letter-spacing: 0.02em;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-list a {
  color: var(--color-text-light);
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.85;
  transition: opacity var(--transition);
}

.nav-list a:hover,
.nav-list a:focus-visible {
  opacity: 1;
}

.nav-list .btn-nav {
  opacity: 1;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-light);
  border-radius: 2px;
  transition: all var(--transition);
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, var(--color-dark) 0%, var(--color-primary) 100%);
  padding: 8rem 0 6rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/Residential Development Hero Image.png') center/cover no-repeat;
  opacity: 0.15;
}

.hero-content {
  position: relative;
  max-width: 700px;
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- Services ---------- */
.services {
  padding: var(--section-padding);
  background: var(--color-bg-alt);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.service-card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.service-image {
  height: 220px;
  overflow: hidden;
}

.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.service-card:hover .service-image img {
  transform: scale(1.05);
}

.service-content {
  padding: 1.75rem;
}

.service-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.service-content p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* ---------- Stats ---------- */
.stats {
  padding: 4rem 0;
  background: var(--color-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
}

/* ---------- How It Works ---------- */
.how-it-works {
  padding: var(--section-padding);
}

.tab-toggle {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-bottom: 3rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--color-text-muted);
}

.tab-btn.active {
  background: var(--color-primary);
  color: var(--color-text-light);
}

.tab-btn:hover:not(.active) {
  background: var(--color-bg-alt);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.step-card {
  padding: 2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.step-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 16px rgba(26, 58, 42, 0.08);
}

.step-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 1.25rem;
}

.step-icon svg {
  width: 100%;
  height: 100%;
  color: var(--color-primary);
}

.step-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
  font-weight: 600;
}

.step-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ---------- Energy ---------- */
.energy {
  padding: var(--section-padding);
  background: var(--color-bg-alt);
}

.energy-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.energy-content .section-title {
  text-align: left;
  margin-bottom: 1.25rem;
}

.energy-content > p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.energy-features {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.energy-feature {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.energy-feature-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
}

.energy-feature-icon svg {
  width: 100%;
  height: 100%;
  color: var(--color-primary);
}

.energy-feature h4 {
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.energy-feature p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.energy-images {
  display: grid;
  gap: 1.5rem;
}

.energy-images img {
  border-radius: var(--radius-lg);
  width: 100%;
  object-fit: cover;
}

/* ---------- FAQ ---------- */
.faq {
  padding: var(--section-padding);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item summary {
  padding: 1.25rem 0;
  font-weight: 500;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transition: color var(--transition);
}

.faq-item summary:hover {
  color: var(--color-primary);
}

.faq-item summary::marker,
.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-text-muted);
  transition: transform var(--transition);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  padding: 0 0 1.25rem;
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ---------- Contact ---------- */
.contact {
  padding: var(--section-padding);
  background: var(--color-bg-alt);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.contact-info .section-title {
  text-align: left;
  margin-bottom: 1rem;
}

.contact-info > p {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.contact-image {
  border-radius: var(--radius-lg);
  width: 100%;
  max-height: 300px;
  object-fit: cover;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
}

.required {
  color: #c0392b;
}

.form-group input,
.form-group textarea {
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--color-bg);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26, 58, 42, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.btn-submit {
  width: 100%;
  padding: 1rem;
}

.btn-submit .btn-loading {
  display: none;
}

.btn-submit.loading .btn-text {
  display: none;
}

.btn-submit.loading .btn-loading {
  display: inline;
}

.form-status {
  font-size: 0.9rem;
  padding: 0;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.form-status.success {
  padding: 0.75rem 1rem;
  background: #e8f5e9;
  color: #2e7d32;
}

.form-status.error {
  padding: 0.75rem 1rem;
  background: #fbe9e7;
  color: #c62828;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-bg-dark);
  padding: 2.5rem 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.footer-name {
  color: var(--color-text-light);
  font-weight: 500;
  font-size: 0.95rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transition: background var(--transition);
}

.footer-social a:hover {
  background: var(--color-accent);
}

.footer-social svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-light);
}

.footer-copy {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  width: 100%;
  text-align: center;
  margin-top: 0.5rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .energy-layout,
  .contact-layout {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --section-padding: 4rem 0;
  }

  /* Mobile nav */
  .main-nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--color-dark);
    padding: 2rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition);
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav-list {
    flex-direction: column;
    gap: 1.5rem;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .mobile-menu-toggle[aria-expanded="true"] .hamburger {
    background: transparent;
  }

  .mobile-menu-toggle[aria-expanded="true"] .hamburger::before {
    top: 0;
    transform: rotate(45deg);
  }

  .mobile-menu-toggle[aria-expanded="true"] .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .hero {
    min-height: 80vh;
    padding: 7rem 0 4rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero-cta {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .stat-number {
    font-size: 2rem;
  }
}

/* ---------- Focus styles for accessibility ---------- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
