/* =========================================================
   GLOBAL VARIABLES
   ========================================================= */
:root {
  --brand-bg: #8A9C91;
  --brand-fg: #D7E6DD;
  --accent: #639372;
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Montserrat', sans-serif;
  --bg-color: #fff;
  --text-color: #333;

  /* Premium UI helpers */
  --card-radius: 8px;
  --card-shadow: 0 10px 30px rgba(0,0,0,0.08); /* Softened for high-end feel */

  /* Social icons */
  --social-size: 36px;
  --social-icon-size: 16px;
  --social-hover-scale: 1.08;

  /* Overlay menu background */
  --overlay-bg: rgba(0,0,0,0.4);
}

/* === Dark Theme Support === */
html[data-theme="dark"] {
  --brand-bg: #2e3b37;
  --brand-fg: #d7e6dd;
  --accent: #9fc8aa;
  --bg-color: #121212;
  --text-color: #e0e0e0;
}

/* =========================================================
   RESET & LAYOUT
   ========================================================= */
html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Enforce elegant typography on all headers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: #2c3e50; /* A sharp, architectural dark tone */
  font-weight: 600;
  margin-top: 0;
}

/* Remove link underlines globally */
a {
  text-decoration: none;
  color: inherit;
}

img,
.responsive-img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Screen reader only elements */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Prevent body scroll when mobile menu is open */
body.nav-open {
  overflow: hidden;
  height: 100%;
}

/* =========================================================
   UTILITY & CONTAINERS
   ========================================================= */
section,
.build-process,
.contact {
  padding: 4rem 0;
}

.container {
  width: 100%;
  max-width: 1200px; /* Constrain max width for ultra-wide monitors */
  margin: 0 auto;
  padding: 0 1.5rem; 
}

.section-title {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* =========================================================
   HEADER & NAVIGATION
   ========================================================= */
header {
  background: var(--brand-bg);
  padding: 0.5rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* === Logo === */
.logo img {
  height: 90px;
  width: auto;
}

/* === Main Navigation (Desktop) === */
.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative; 
}

.main-nav .nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Nav links appearance */
.nav-links a {
  padding: 0.5rem 0.75rem;
  font-weight: 500;
  color: var(--brand-fg);
  transition: color 0.3s, background 0.3s;
  border-radius: 4px;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: #fff;
  background: rgba(0,0,0,0.1);
}

.nav-cta {
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 6px;
}

/* =========================================================
   SOCIAL ICONS (Header & Footer)
   ========================================================= */
.socials {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.25rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--social-size);
  height: var(--social-size);
  border-radius: 6px;
  color: var(--brand-fg);
  background: rgba(0,0,0,0.08);
  transition: all 0.2s ease;
  outline: none;
}

.social-link i {
  font-size: var(--social-icon-size);
  line-height: 1;
}

.social-link:hover {
  transform: scale(var(--social-hover-scale));
  background: rgba(0,0,0,0.14);
  color: #fff;
}

.social-link:focus-visible {
  box-shadow: 0 0 0 3px rgba(99,147,114,0.35);
}

/* =========================================================
   NAV TOGGLE & MOBILE OVERLAY
   ========================================================= */
.nav-toggle {
  display: none;
  position: relative;
  border: 0;
  background: transparent;
  width: 44px;
  height: 44px;
  cursor: pointer;
}

.nav-toggle .nav-toggle-icon {
  font-size: 22px;
  color: var(--brand-fg);
  line-height: 1;
  pointer-events: none;
}

.nav-close {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: var(--brand-fg);
  cursor: pointer;
  font-size: 26px;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 999; 
}

/* =========================================================
   HERO SECTION
   ========================================================= */
.hero {
  position: relative;
  min-height: 80vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
}

.hero .hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem 2rem;
  color: #fff;
  background: rgba(44, 62, 80, 0.6); /* Darker, more elegant overlay */
  backdrop-filter: blur(4px); /* Modern frosted glass effect */
  border-radius: var(--card-radius);
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: #fff;
  margin-bottom: 1rem;
}

.hero p {
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  margin-bottom: 2rem;
  font-family: var(--font-body);
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn, .btn-primary {
  display: inline-block;
  font-family: var(--font-body);
  background: var(--brand-bg);
  color: #fff;
  padding: 1rem 2.5rem;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  text-align: center;
}

.btn:hover, .btn-primary:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(99,147,114,0.4);
}

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

/* =========================================================
   BUILD PROCESS (Flip Cards)
   ========================================================= */
.build-process {
  background: #f4f7f6;
  text-align: center;
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (min-width: 1200px) {
  .process-grid {
    grid-template-columns: repeat(7, 1fr);
    justify-items: center;
    align-items: stretch;
  }
}

.process-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.1;
  perspective: 1000px;
  cursor: pointer;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s ease;
  transform-style: preserve-3d;
  border-radius: var(--card-radius);
}

.process-card:hover .card-inner,
.process-card.is-flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.card-face.front {
  background: #fff;
  color: #333;
  border: 1px solid #eaeaea;
  padding: 1rem;
  transition: transform 0.3s ease;
}

.card-face.front i {
  font-size: 2rem;
  color: var(--brand-bg);
  margin-bottom: 0.5rem;
}

.card-face.front strong {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.card-face.front span {
  font-size: 0.95rem;
  color: #666;
}

.card-face.back {
  transform: rotateY(180deg);
  background: #000;
  padding: 0;
}

.card-face.back img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   ABOUT SECTION (Modern Grid)
   ========================================================= */
.about {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 4rem;
  align-items: start;
}

.about-img {
  width: 100%;
  position: sticky; 
  top: 6rem; /* Accounts for sticky header */
}

.about-img img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px; 
  box-shadow: var(--card-shadow);
}

.about-text {
  max-width: 900px;
}

.about-text .sub-title {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 1.5rem;
  display: block;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.about-text p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  font-size: 1.1rem;
  color: #444;
}

@media (max-width: 992px) {
  .about {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .about-img {
    position: static;
    max-width: 500px;
    margin: 0 auto;
  }
}

/* =========================================================
   SERVICES
   ========================================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.service-card {
  background: #fff;
  border: 1px solid #eaeaea;
  border-top: 4px solid var(--brand-bg);
  border-radius: var(--card-radius);
  padding: 2rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.3s ease;
}

.service-card:hover {
  transform: translateY(-5px);
}

.service-card h3 {
  color: var(--brand-bg);
  margin-bottom: 1rem;
}

/* =========================================================
   PROJECTS GALLERY (From Projects Page)
   ========================================================= */
.gallery {
  padding-top: 2rem;
}

@supports (content-visibility: auto) {
  .gallery {
    content-visibility: auto;
    contain-intrinsic-size: 1000px;
  }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 4 / 3; 
  background: #f2f2f2;
  position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 4 / 3;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

/* =========================================================
   TESTIMONIALS
   ========================================================= */
.testimonials .testimonial-card {
  background: #f9f9f9;
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  font-style: italic;
}

/* =========================================================
   PARTNERS / LOGOS (With Premium Grayscale Hover Effect)
   ========================================================= */
#affiliations {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid #eaeaea;
  text-align: center;
}

.logo-grid,
.member-logos-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4rem;
  padding: 2rem 0;
}

.logo-grid img,
.member-logos-grid img {
  max-height: 85px; 
  max-width: 200px;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all 0.4s ease;
}

.logo-grid img:hover,
.member-logos-grid img:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.05);
}

@media (max-width: 992px) {
  .logo-grid, .member-logos-grid {
    gap: 2.5rem;
  }
  .logo-grid img, .member-logos-grid img {
    max-height: 65px;
  }
}

/* =========================================================
   CONTACT PAGE (Modern Split Layout)
   ========================================================= */
.contact-header {
  text-align: center;
  margin-bottom: 3rem;
}

.contact-header p {
  font-size: 1.1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 4rem;
  align-items: start;
}

.contact-info-card {
  background: #f9f9f9;
  padding: 2.5rem;
  border-radius: 4px;
  box-shadow: var(--card-shadow);
  border-top: 4px solid var(--brand-bg);
}

.contact-info-card h3 {
  margin-top: 0;
  font-size: 1.5rem;
  color: var(--brand-bg);
  margin-bottom: 1.5rem;
}

.contact-info-card p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

.contact-info-card a {
  color: var(--brand-bg);
  text-decoration: none;
  font-weight: 600;
}

.contact-info-card a:hover {
  text-decoration: underline;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  background: #fff;
  padding: 2.5rem;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid #eaeaea;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  font-family: var(--font-body);
  background-color: #fafafa;
  transition: all 0.3s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--brand-bg);
  box-shadow: 0 0 0 3px rgba(138, 156, 145, 0.2);
  background-color: #fff;
}

.contact-form select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 16px;
}

.contact-form .btn {
  align-self: flex-start;
  margin-top: 0.5rem;
}

@media (max-width: 768px) {
  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */
footer {
  background: var(--brand-bg);
  color: var(--brand-fg);
  text-align: center;
  font-size: 0.95rem;
  padding: 2.5rem 1rem;
  margin-top: auto;
}

footer a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

footer a:hover {
  text-decoration: underline;
}

footer .socials {
  margin-top: 1rem;
  gap: 0.8rem;
}

/* =========================================================
   MOBILE OVERLAY NAVIGATION
   ========================================================= */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-nav {
    position: fixed;
    inset: 0;
    background: var(--brand-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 96px; 
    gap: 1rem;
    transform: translateY(-100%);
    transition: transform 0.28s ease-in-out;
    z-index: 1001; 
  }

  .nav-backdrop[hidden] {
    display: none;
  }

  body.nav-open .main-nav {
    transform: translateY(0);
  }

  body.nav-open .nav-backdrop {
    display: block;
  }

  .nav-close {
    display: block;
  }

  .main-nav .nav-links {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .nav-links a {
    display: block;
    font-size: 1.2rem; /* Larger tap targets */
  }

  .main-nav .socials {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.2);
  }

  .logo img {
    height: 72px;
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .process-card .card-inner,
  .btn,
  .service-card,
  .gallery-grid img,
  .logo-grid img {
    transition: none;
  }
  .main-nav {
    transition: none;
  }
}

/* =========================================================
   COOKIE POPUP
   ========================================================= */
.cookie-popup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #2c3e50; /* Changed to dark architectural gray to pop against the green */
  color: #fff;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 320px;
  box-shadow: var(--card-shadow);
  z-index: 9999;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.cookie-popup.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}

.cookie-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cookie-box p {
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

.cookie-box .btn {
  align-self: flex-end;
  background: var(--brand-bg);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
}

.cookie-box .btn:hover {
  background: var(--accent);
}

@media (max-width: 600px) {
  .cookie-popup {
    left: 10px;
    right: 10px;
    bottom: 10px;
    max-width: unset;
  }
}