/* ============================================
   Emberfly Branding — Global Styles
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f5;
  --color-bg-dark: #000000;
  --color-text: #000000;
  --color-text-light: #333333;
  --color-text-muted: #797979;
  --color-accent: #000000;
  --color-accent-hover: #333333;
  --color-accent-light: rgba(0, 0, 0, 0.04);
  --color-highlight: #FA8E06;
  --color-border: #d9d9d9;
  --color-border-light: #ebebeb;
  --font-primary: "Raleway", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-heading: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max-width: 1400px;
  --gutter: 4vw;
  --nav-height: 72px;
  --transition: 0.3s ease;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  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: var(--color-text);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  opacity: 0.7;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.25;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-family: var(--font-primary);
  font-weight: 600;
}

h4 {
  font-size: 1.1rem;
  font-family: var(--font-primary);
  font-weight: 600;
}

p {
  margin-bottom: 1.2em;
  color: var(--color-text-light);
}

p:last-child {
  margin-bottom: 0;
}

/* ============================================
   Layout
   ============================================ */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  padding: 80px 0;
}

.section--alt {
  background: var(--color-bg-alt);
}

.section--dark {
  background: var(--color-bg-dark);
  color: #ffffff;
}

.section--dark h2,
.section--dark h3 {
  color: #ffffff;
}

.section--dark p {
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Navigation
   ============================================ */

.site-nav {
  position: relative;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--color-border-light);
  height: var(--nav-height);
  transition: background var(--transition);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo img {
  height: 32px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
  padding: 4px 0;
  position: relative;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--color-text);
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover {
  opacity: 0.6;
}

/* Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-dropdown-toggle::after {
  content: '';
  display: none;
}

.nav-dropdown-arrow {
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--color-text);
  border-bottom: 1.5px solid var(--color-text);
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition);
}

.nav-dropdown:hover .nav-dropdown-arrow {
  transform: rotate(-135deg) translateY(-2px);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: -16px;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  padding: 8px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--transition);
  list-style: none;
}

.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 0.85rem;
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.nav-dropdown-menu a:hover {
  background: var(--color-bg-alt);
}

.nav-dropdown-menu a::after {
  display: none;
}

/* Mobile hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  margin-right: -8px;
  background: none;
  border: none;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all var(--transition);
  border-radius: 1px;
}

.nav-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Dark nav for homepage hero */
.site-nav--dark {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.site-nav--dark .nav-logo,
.site-nav--dark .nav-links a {
  color: #ffffff;
}

.site-nav--dark .nav-dropdown-arrow {
  border-color: #ffffff;
}

.site-nav--dark .nav-hamburger span {
  background: #ffffff;
}

.site-nav--dark .nav-links a:hover {
  opacity: 0.7;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-block;
  padding: 14px 36px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.btn--primary {
  background: var(--color-text);
  color: #ffffff;
}

.btn--primary:hover {
  background: var(--color-accent);
  color: #ffffff;
}

.btn--outline {
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-text);
}

.btn--outline:hover {
  background: var(--color-text);
  color: #ffffff;
}

.btn--white {
  background: #ffffff;
  color: var(--color-text);
}

.btn--white:hover {
  background: var(--color-accent);
  color: #ffffff;
}

/* ============================================
   Hero Sections (non-homepage)
   ============================================ */

.page-hero {
  padding: 80px 0;
  background: var(--color-bg-alt);
}

.page-hero h1 {
  margin-bottom: 20px;
}

.page-hero p {
  font-size: 1.15rem;
  max-width: 720px;
  line-height: 1.8;
}

.page-hero .btn {
  margin-top: 24px;
}

/* ============================================
   Homepage Hero (Firefly)
   ============================================ */

.hero-firefly {
  position: relative;
  background: #0a0a0a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: calc(var(--nav-height) + 20px) 15px 40px;
}

.hero-firefly .scroll-indicator {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeInUp 1s ease 2s both;
}

.hero-firefly .scroll-indicator span {
  display: block;
  width: 1px;
  height: 24px;
  background: linear-gradient(to bottom, rgba(255, 200, 80, 0.4), transparent);
  animation: scrollPulse 2s ease infinite;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; height: 24px; }
  50% { opacity: 0.8; height: 32px; }
}

/* ============================================
   Intro / About Sections
   ============================================ */

.intro-section {
  text-align: center;
  padding: 100px 0;
}

.intro-section h2 {
  margin-bottom: 16px;
}

.intro-section p {
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.1rem;
}

.intro-section .butterfly-icon {
  width: 80px;
  height: auto;
  margin: 0 auto 24px;
  opacity: 0.85;
}

/* Two-column layout for about hero */
.about-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.about-hero-text h1 {
  margin-bottom: 16px;
}

.about-hero-text p {
  font-size: 1.1rem;
}

.about-hero-image img {
  border-radius: 8px;
  width: 100%;
}

/* Content sections */
.content-section {
  padding: 60px 0;
}

.content-section + .content-section {
  border-top: 1px solid var(--color-border-light);
}

.content-section h2 {
  margin-bottom: 20px;
}

.content-section p {
  max-width: 780px;
  font-size: 1.05rem;
}

/* ============================================
   Services Grid (Homepage)
   ============================================ */

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.service-card {
  padding: 32px 0;
  border: none;
  transition: all var(--transition);
}

.service-card:hover {
  opacity: 0.85;
}

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

.service-card p {
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 16px;
}

.service-card .learn-more {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.service-card .learn-more:hover {
  opacity: 0.7;
}

/* ============================================
   Problem Statement
   ============================================ */

.problem-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

.problem-section ul {
  list-style: none;
  padding: 0;
}

.problem-section ul li {
  padding: 10px 0;
  padding-left: 20px;
  position: relative;
  color: var(--color-text-light);
  font-size: 1.05rem;
}

.problem-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

.value-prop h3 {
  margin-bottom: 16px;
}

.value-prop p {
  font-size: 1.05rem;
}

.value-prop .tagline-text {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--color-text);
  margin-top: 12px;
}

/* ============================================
   Testimonials
   ============================================ */

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.testimonial {
  padding: 32px 0;
  background: transparent;
  position: relative;
}

.testimonial blockquote {
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.7;
  color: var(--color-text-light);
  margin-bottom: 16px;
}

.testimonial cite {
  font-style: normal;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  display: block;
}

.testimonial cite span {
  font-weight: 400;
  color: var(--color-text-muted);
  display: block;
  margin-top: 2px;
}

/* ============================================
   CTA Footer Section
   ============================================ */

.cta-section {
  text-align: center;
  padding: 80px 0;
  background: var(--color-bg-dark);
  color: #ffffff;
}

.cta-section h2 {
  color: #ffffff;
  margin-bottom: 16px;
}

.cta-section p {
  color: rgba(255, 255, 255, 0.75);
  max-width: 520px;
  margin: 0 auto 28px;
  font-size: 1.1rem;
}

/* ============================================
   Service Page — Details
   ============================================ */

.service-details {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  align-items: start;
}

.service-sidebar h4 {
  margin-bottom: 12px;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.service-sidebar ul {
  list-style: none;
  padding: 0;
  margin-bottom: 32px;
}

.service-sidebar ul li {
  padding: 6px 0;
  font-size: 0.92rem;
  color: var(--color-text-light);
  position: relative;
  padding-left: 16px;
}

.service-sidebar ul li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--color-accent);
}

.service-main h3 {
  margin-bottom: 16px;
  font-size: 1.2rem;
}

.service-main p {
  font-size: 1.02rem;
}

.service-main ul {
  list-style: none;
  padding: 0;
}

.service-main ul li {
  padding: 8px 0;
  padding-left: 20px;
  position: relative;
  font-size: 0.98rem;
  color: var(--color-text-light);
}

.service-main ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* ============================================
   Image Gallery
   ============================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition);
  background: var(--color-bg-alt);
}

.gallery-item:hover {
  transform: scale(1.02);
}

.gallery-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 40px;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   Trusted By Section
   ============================================ */

.trusted-by {
  padding: 60px 0;
}

.trusted-category {
  margin-bottom: 32px;
}

.trusted-category h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.trusted-category p {
  font-size: 0.95rem;
  color: var(--color-text-light);
}

/* ============================================
   Site Footer
   ============================================ */

.site-footer {
  padding: 32px 0;
  border-top: 1px solid var(--color-border-light);
  text-align: center;
}

.site-footer p {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

/* ============================================
   Spacer
   ============================================ */

.spacer-nav {
  height: 0;
}

/* ============================================
   Responsive — Tablet
   ============================================ */

@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .problem-section {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .service-details {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-hero-image {
    order: -1;
    max-width: 400px;
    margin: 0 auto;
  }
}

/* ============================================
   Responsive — Mobile
   ============================================ */

@media (max-width: 768px) {
  :root {
    --gutter: 6vw;
    --nav-height: 60px;
  }

  .section {
    padding: 60px 0;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    padding: 32px var(--gutter);
    gap: 0;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  }

  .nav-links.active {
    display: flex;
  }

  .site-nav--dark .nav-links {
    background: #0a0a0a;
  }

  .nav-links > li {
    border-bottom: 1px solid var(--color-border-light);
  }

  .site-nav--dark .nav-links > li {
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .nav-links a {
    display: block;
    padding: 16px 0;
    font-size: 1rem;
  }

  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 0 0 0 16px;
  }

  .nav-dropdown-menu a {
    padding: 12px 0;
  }

  .nav-hamburger {
    display: flex;
  }

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

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item img {
    height: 160px;
  }

  .page-hero {
    padding: 60px 0;
  }

  .intro-section {
    padding: 60px 0;
  }

  .hero-firefly {
    padding-top: 30px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item img {
    height: 200px;
  }
}
