/* ===========================
   Variables & Typography
   =========================== */
:root {
  --primary-blue: #1a4b7d;
  --light-gray: #f8f9fa;
  --medium-gray: #e5e7eb;
  --dark-gray: #343a40;
  --text-gray: #4b5563;
  --white: #fff;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);

  --max-width: 1200px;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;
}

body {
  font-family: 'Montserrat', sans-serif;
  color: #1a1a1a;
  background-color: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--primary-blue);
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--primary-blue);
}

p {
  font-family: 'Lora', serif;
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-gray);
  margin: 0;
}

/* ===========================
   Layout & Container
   =========================== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.section {
  padding: var(--spacing-lg) 0;
}

/* ===========================
   Header & Navigation
   =========================== */
.header {
  background-color: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--spacing-md);
  flex-wrap: wrap;
  gap: 1rem;
  transition: padding 0.3s ease;
}

.logo-link {
  flex-shrink: 0;
}

.logo {
  height: 60px;
  width: auto;
  transition: height 0.3s ease;
}

.contact-info {
  display: none;
  align-items: center;
  gap: var(--spacing-md);
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--dark-gray);
}

.contact-icon {
  width: 20px;
  height: 20px;
  fill: var(--primary-blue);
}

.nav {
  width: 100%;
  margin-top: 1rem;
  border-top: 1px solid var(--medium-gray);
  padding-top: 1rem;
}

.nav-list {
  display: flex;
  gap: var(--spacing-md);
  justify-content: center;
}

.nav-link {
  color: var(--text-gray);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  background-color: var(--light-gray);
  color: var(--primary-blue);
}

.nav-call-btn {
  background: #08578a;
  color: #ffffff !important;
  padding: 0.5rem 1.25rem;
  border-radius: 25px;
  font-weight: 500;
}

.nav-call-btn:hover {
  background: #0a2540 !important;
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(8, 87, 138, 0.3);
}

/* ===========================
   Hero Section
   =========================== */
.hero {
  position: relative;
  height: 60vh;
  min-height: 400px;
  /* Default/Mobile: 800w */
  background-image: url('../images/hero-800w.jpg');
  background-image: image-set(
    url('../images/hero-800w.avif') type('image/avif'),
    url('../images/hero-800w.webp') type('image/webp'),
    url('../images/hero-800w.jpg') type('image/jpeg')
  );
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  padding-top: 2vh;
}

/* Tablet: 1200w */
@media (min-width: 769px) {
  .hero {
    background-image: url('../images/hero-1200w.jpg');
    background-image: image-set(
      url('../images/hero-1200w.avif') type('image/avif'),
      url('../images/hero-1200w.webp') type('image/webp'),
      url('../images/hero-1200w.jpg') type('image/jpeg')
    );
  }
}

/* Desktop: 1920w */
@media (min-width: 1025px) {
  .hero {
    background-image: url('../images/hero-1920w.jpg');
    background-image: image-set(
      url('../images/hero-1920w.avif') type('image/avif'),
      url('../images/hero-1920w.webp') type('image/webp'),
      url('../images/hero-1920w.jpg') type('image/jpeg')
    );
  }
}

/* Large Desktop: 2560w */
@media (min-width: 1921px) {
  .hero {
    background-image: url('../images/hero-2560w.jpg');
    background-image: image-set(
      url('../images/hero-2560w.avif') type('image/avif'),
      url('../images/hero-2560w.webp') type('image/webp'),
      url('../images/hero-2560w.jpg') type('image/jpeg')
    );
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: var(--spacing-md);
}

.hero h1 {
  color: #08578a;
  margin-bottom: 1rem;
  font-size: clamp(2.5rem, calc(3vw + 1.5vh), 4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
}

.hero p {
  color: #08578a;
  font-size: clamp(1.25rem, calc(1.25vw + 0.75vh), 1.75rem);
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

.hero-call-btn {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: #08578a;
  color: #ffffff;
  padding: 0.625rem 1.75rem;
  border-radius: 50px;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(8, 87, 138, 0.3);
  z-index: 10;
}

.hero-call-btn:hover {
  background: #0a2540;
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(8, 87, 138, 0.4);
}

/* ===========================
   Services Section (Flip Cards)
   =========================== */
.services-modern {
  position: relative;
  padding: 8rem 0;
  background: #f8f9fa;
  overflow: hidden;
}

.diagonal-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(135deg, #1a4b7d 0%, #2a5b8d 100%);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
  z-index: 0;
}

.section-heading {
  font-size: 2.75rem;
  text-align: center;
  color: #ffffff;
  margin-bottom: 4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}

.services-flip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  perspective: 1000px;
  position: relative;
  z-index: 1;
}

.flip-card {
  background: transparent;
  height: 300px;
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

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

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.flip-card-front {
  background: #ffffff;
  color: #1a4b7d;
}

.flip-card-back {
  background: linear-gradient(135deg, #1a4b7d 0%, #0a2540 100%);
  color: #ffffff;
  transform: rotateY(180deg);
}

.card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.flip-card-front h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.flip-card-front p {
  font-size: 1rem;
  color: #666;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
}

.flip-card-back h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  text-align: center;
  color: #ffffff;
}

.flip-card-back p {
  font-size: 1rem;
  text-align: center;
  line-height: 1.6;
  opacity: 0.95;
  color: #ffffff;
}

/* ===========================
   About Section
   =========================== */
.about-minimal {
  padding: 8rem 0;
  background: #ffffff;
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

.about-split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 6rem;
  align-items: center;
}

.label {
  display: inline-block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #1a4b7d;
  margin-bottom: 1rem;
}

.about-info h2 {
  font-size: 3rem;
  color: #1a1a1a;
  margin-bottom: 1rem;
  font-weight: 800;
}

.lead {
  font-size: 1.5rem;
  color: #666;
  margin-bottom: 2rem;
  font-weight: 400;
}

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

.credentials {
  display: flex;
  gap: 3rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.cred-item {
  display: flex;
  flex-direction: column;
}

.cred-item .num {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: #1a4b7d;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.cred-item .txt {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

.about-visual {
  position: relative;
  height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.visual-image {
  width: 80%;
  max-width: 500px;
  height: 100%;
  min-height: 350px;
  object-fit: cover;
  object-position: center 15%;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(26, 75, 125, 0.3);
  transition: transform 0.4s ease;
}

.about-visual:hover .visual-image {
  transform: scale(1.05);
}

/* ===========================
   Contact Section
   =========================== */
.contact-bold {
  background: linear-gradient(135deg, #0a2540 0%, #1a4b7d 100%);
  color: #ffffff;
  padding: 6rem 0;
  text-align: center;
}

.contact-bold h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 800;
  color: #ffffff;
}

.contact-intro {
  font-size: 1.25rem;
  margin-bottom: 4rem;
  opacity: 0.95;
  color: #ffffff;
}

.contact-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.contact-block {
  background: rgba(255, 255, 255, 0.1);
  padding: 2.5rem 1.5rem;
  border-radius: 16px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  display: block;
  cursor: pointer;
}

.contact-block:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-5px);
}

.block-label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 1rem;
  opacity: 0.8;
  color: #ffffff;
}

.contact-block-content {
  color: #ffffff;
  font-size: 1rem;
  line-height: 1.6;
  display: block;
  white-space: nowrap;
}

.contact-block-content strong {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  display: inline;
  color: #ffffff;
}

/* ===========================
   Footer
   =========================== */
.footer-minimal {
  background: #0a2540;
  color: rgba(255, 255, 255, 0.7);
  padding: 2.5rem 0;
}

.footer-minimal .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-minimal p {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
}

.footer-nav {
  display: flex;
  gap: 2rem;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: #ffffff;
}

/* ===========================
   Responsive Design
   =========================== */
@media (min-width: 768px) {
  .header-content {
    flex-wrap: nowrap;
  }

  .nav {
    width: auto;
    margin-top: 0;
    border-top: none;
    padding-top: 0;
    margin-left: auto;
  }

  .nav-list {
    justify-content: flex-end;
  }
}

@media (max-width: 1024px) {
  .about-split {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-visual {
    height: 400px;
  }
}

@media (max-width: 1150px) {
  /* Force stacked layout for contact blocks to prevent email from wrapping */
  .contact-blocks {
    grid-template-columns: 1fr;
    max-width: 500px;
  }
}

@media (max-width: 768px) {
  .contact-info {
    width: 100%;
    justify-content: center;
  }

  .services-flip-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    height: 50vh;
  }

  /* Center and enlarge logo when nav wraps to next line */
  .header-content {
    justify-content: center;
    flex-direction: column;
    align-items: center;
  }

  .logo-link {
    margin-bottom: 0;
  }

  .logo {
    height: 80px;
  }

  /* Shrink header when scrolled (mobile only) */
  .header-scrolled .header-content {
    padding: 0.5rem var(--spacing-md);
  }

  .header-scrolled .logo {
    height: 50px;
  }

  .nav {
    width: 100%;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }

  .section-heading {
    font-size: 2rem;
  }

  .about-info h2 {
    font-size: 2.25rem;
  }

  .lead {
    font-size: 1.25rem;
  }

  .credentials {
    gap: 2rem;
  }

  .contact-bold h2 {
    font-size: 2.25rem;
  }

  .footer-minimal .container {
    flex-direction: column-reverse;
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
  }

  .contact-item {
    font-size: 0.85rem;
  }

  /* Keep navigation horizontal on iPhone - there's plenty of space */
  .nav-list {
    gap: 0.5rem;
  }

  .nav-link {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }

  .contact-block a {
    font-size: 0.95rem;
  }

  .contact-block strong {
    font-size: 1.05rem;
  }
}

/* Only stack navigation on very small devices (< 360px) */
@media (max-width: 359px) {
  .nav-list {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
}
