/* ------------------- */
/* Design tokens */
:root {
  --bg: #ffffff;
  --text: #1b1b1b;
  --muted: #5a5a5a;
  --brand: #2f5d62;
  --brand-2: #bcd4d0;
  --accent: #c7a17a;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --container: 1100px;

  /* Luxurious blues */
  --lux-blue: #1f4e79;          
  --lux-blue-2: #2a628f;        
  --lux-text: #e9f2f8;          
}

/* ------------------- */
/* Base styles */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: 'Inter', sans-serif; color: var(--text); line-height: 1.6; }
body.services { background: var(--bg); }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: var(--text); }
a:hover { opacity: 0.85; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
body.no-scroll { overflow: hidden; }

/* ------------------- */
/* Header */
.site-header {
  position: absolute;
  top: 0; left: 0; width: 100%;
  background: transparent;
  z-index: 50;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 4px 0;
}

.header-left { flex: 0 0 auto; }
.site-logo { width: 100px; height: auto; cursor: pointer; }

/* Navigation */
.site-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  font-family: 'Playfair Display', serif;
}

.site-nav ul {
  display: flex;
  gap: 16px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: #fff;
  padding: 8px 12px;
  border-radius: 50px;
  font-weight: 500;
  display: inline-block;
  position: relative;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--brand-2);
  transition: width 0.3s ease;
}

.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { width: 100%; }

.site-nav .btn-black {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 50px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border: 2px solid var(--accent);
  transition: all 0.3s ease;
}

.site-nav .btn-black:hover { background: #b48e66; border-color: #b48e66; }

/* Social icons aligned to top */
.header-right {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 16px;
  margin-top: 0;
  padding-top: 0;
}

.social-icon {
  width: 24px;
  height: 24px;
  margin-top: 0;
  padding-top: 0;
}

/* ------------------- */
/* Mobile Hamburger */
.nav-toggle {
  display: none;
  position: absolute;
  left: 50%;
  top: 36px;
  transform: translateX(-50%);
  width: 32px;
  height: 26px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 9999;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 3px;
  transition: 0.3s ease;
}

.nav-toggle span:nth-child(2) { margin: 6px 0; }

.nav-toggle.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ------------------- */
/* Slide-in mobile menu */
.mobile-menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 70%;
  max-width: 320px;
  height: 100vh;
  background: #fff;
  padding: 100px 24px;
  box-shadow: -4px 0 25px rgba(0,0,0,0.25);
  transform: translateX(100%);
  transition: transform 0.35s ease;
  z-index: 999;
}

.mobile-menu-panel.open { transform: translateX(0); }

.mobile-menu-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.mobile-menu-panel a {
  font-size: 20px;
  font-weight: 600;
  color: #000;
}

.mobile-menu-panel .btn-black {
  display: block;
  background: black;
  color: white;
  padding: 12px;
  border-radius: 50px;
  text-align: center;
}

/* Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
  z-index: 900;
}
.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ------------------- */
/* Hero Section */
.hero-services {
  position: relative;
  min-height: 80vh;
  display: grid;
  place-items: center;
  text-align: center;
  overflow: hidden;
}

.hero-services .hero-image {
  position: absolute;
  inset: 0;
  background: url("../images/rafters.jpg") center/cover no-repeat;
  background-size: cover;
  z-index: -2;
}

.hero-services .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(47,93,98,0.55) 0%, rgba(47,93,98,0.55) 70%, rgba(47,93,98,0.15) 90%, #ffffff 100%);
  z-index: -1;
}

.hero-services .hero-content {
  position: relative;
  max-width: 760px;
  padding: calc(40px + 8vh) 24px 0;
  color: #fff;
}

/* ------------------- */
/* Hero Fonts - requested change */
.site-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 72px;
  font-weight: 500;
}

.site-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
}

/* ------------------- */
/* Intro Section */
.services-intro {
  margin-top: 40px;
  padding: 60px 24px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.intro-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 72px;
  font-weight: 500;
  color: var(--brand);
  flex: 0 0 220px;
  position: relative;
}

.section-title::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 0;
  height: 100%;
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.brief-text {
  flex: 1;
  font-family: 'Lora', serif;
  font-size: 18px;
  line-height: 1.85;
  color: var(--muted);
}

.brief-text p { margin-bottom: 16px; }

/* ------------------- */
/* Service Cards */
.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 48px;
  margin: 40px auto 80px;
  max-width: 760px;
  justify-items: center;
}

.service-card {
  background: linear-gradient(135deg, #1f4e79 0%, #2a628f 100%);
  border-radius: var(--radius);
  padding: 24px 32px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  text-align: center;
  color: #e9f2f8;

  /* Fly-in initial state */
  opacity: 0;
  transform: translateY(40px) scale(0.98);
  will-change: transform, opacity;
  transition: box-shadow 0.3s ease, transform 0.25s ease;
}

.service-card:hover {
  transform: translateY(-4px) scale(1);
  box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.service-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  color: #d7e6f2;
  margin-bottom: 12px;
  position: relative;
}

.service-card h3::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background: var(--accent);
  margin: 8px auto 0;
  border-radius: 2px;
}

.service-card p {
  font-family: 'Lora', serif;
  font-size: 16px;
  color: #f2f7fb;
  line-height: 1.75;
  margin-top: 12px;
}

/* Fly-in keyframes */
@keyframes flyInUp {
  from { opacity: 0; transform: translateY(40px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Triggered by JS: add .visible to each card when in viewport */
.service-card.visible {
  animation: flyInUp 700ms ease-out forwards;
}

/* Elegant stagger */
.service-card.visible:nth-child(1) { animation-delay: 0ms; }
.service-card.visible:nth-child(2) { animation-delay: 120ms; }
.service-card.visible:nth-child(3) { animation-delay: 240ms; }
.service-card.visible:nth-child(4) { animation-delay: 360ms; }

/* Optional CSS-only animate on initial page load:
   Add class 'animate-on-load' to .service-grid in HTML to test without JS */
.service-grid.animate-on-load .service-card {
  animation: flyInUp 700ms ease-out forwards;
}
.service-grid.animate-on-load .service-card:nth-child(2) { animation-delay: 120ms; }
.service-grid.animate-on-load .service-card:nth-child(3) { animation-delay: 240ms; }
.service-grid.animate-on-load .service-card:nth-child(4) { animation-delay: 360ms; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .service-card,
  .service-card.visible,
  .service-grid.animate-on-load .service-card {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ------------------- */
/* CTA Section */
.cta-wide {
  background: var(--brand);
  color: #fff;
  padding: 80px 24px;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 80px;
}

.cta-wide h2 {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  margin-bottom: 16px;
}

.cta-wide p {
  font-family: 'Lora', serif;
  font-size: 18px;
  margin-bottom: 24px;
}

.cta-wide .btn-primary {
  padding: 14px 28px;
  border-radius: 50px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border: 2px solid var(--accent);
  transition: all 0.3s ease;
}

.cta-wide .btn-primary:hover {
  background: #b48e66;
  border-color: #b48e66;
}

/* ------------------- */
/* Responsive */
@media (max-width: 1024px) {
  .hero-services .site-title { font-size: 56px; }
  .hero-services .site-subtitle { font-size: 24px; }
  .intro-wrapper { gap: 32px; }
  .section-title { font-size: 32px; flex: 0 0 180px; }
  .service-grid { gap: 32px; }
}

@media (max-width: 768px) {
  .site-logo { max-width: 80px; height: auto; }
  .site-nav ul { display: none; }
  .nav-toggle { display: block; }
  .hero-services .hero-content { padding: calc(60px + 8vh) 16px 0; }
  .intro-wrapper { flex-direction: column; align-items: flex-start; }
  .section-title { flex: none; margin-bottom: 16px; }
  .service-grid { grid-template-columns: 1fr; max-width: 100%; }
}

/* Desktop nav fix */
@media (min-width: 769px) {
  .site-nav {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .site-nav ul { justify-content: center; }
}
