/* Shared header/footer styles live in shared.css */

/* System theme detection */
@media (prefers-color-scheme: light) {
  body {
    background: #f8fafc;
    color: var(--slate-900);
  }
}

.hero {
  position: relative;
  padding: clamp(4rem, 7vw, 5.5rem) 0 clamp(3rem, 6vw, 4rem);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(11, 17, 32, 0.5);
  z-index: -1;
}

@media (prefers-color-scheme: light) {
  .hero::before {
    background: rgba(248, 250, 252, 0.3);
  }
}

/* Light theme (explicit) overrides when body has .theme-light */
body.theme-light .hero::before {
  background: rgba(248, 250, 252, 0.3);
}
body.theme-light .hero-paragraph {
  color: var(--slate-600);
}
body.theme-light .metric-card {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(100, 116, 139, 0.3);
  color: var(--slate-700);
}
body.theme-light .service-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(100, 116, 139, 0.25);
  box-shadow: 0 24px 45px rgba(15, 23, 42, 0.12);
}
body.theme-light .service-meta {
  color: var(--slate-600);
}
body.theme-light .highlight-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(100, 116, 139, 0.2);
  color: var(--slate-700);
}
body.theme-light .testimonial-card {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(100, 116, 139, 0.25);
  color: var(--slate-700);
}
body.theme-light .testimonial-author {
  color: var(--slate-600);
}

.hero-grid {
  display: grid;
  gap: clamp(2.5rem, 4.5vw, 3.75rem);
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: flex-start;
  justify-items: start;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    align-items: flex-start;
  }
}

.hero-copy {
  display: grid;
  gap: 1.65rem;
  max-width: 640px;
}

.hero-title {
  font-size: clamp(2.2rem, 3.8vw, 3.2rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.highlight-emerald {
  color: var(--emerald);
}

.highlight-sky {
  color: var(--sky);
}

.subtitle-line {
  color: var(--sky);
  font-style: italic;
  font-weight: 400;
  font-size: 0.85em;
}

.hero-paragraph {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  color: rgba(226, 232, 240, 0.82);
  max-width: 60ch;
}

@media (prefers-color-scheme: light) {
  .hero-paragraph {
    color: var(--slate-600);
  }
}

.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
  width: 100%;
}

.hero-cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.5rem;
}

.hero-cta-buttons .btn {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .hero-cta-buttons {
    flex-direction: column;
  }

  .hero-cta-buttons .btn {
    width: 100%;
    text-align: center;
  }
}

.metric-card {
  background: rgba(8, 12, 28, 0.5);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 140px;
}

@media (min-width: 768px) {
  .metric-card {
    padding: 0.5rem 1rem;
    gap: 0.5rem;
  }
}

.metric-card strong {
  font-size: 0.85rem;
  font-weight: 700;
}

@media (min-width: 768px) {
  .metric-card strong {
    font-size: 0.95rem;
  }
}

.metric-card span {
  font-size: 0.75rem;
  opacity: 0.85;
}

@media (min-width: 768px) {
  .metric-card span {
    font-size: 0.85rem;
  }
}

@media (prefers-color-scheme: light) {
  .metric-card {
    background: rgba(248, 250, 252, 0.9);
    border-color: rgba(100, 116, 139, 0.3);
    color: var(--slate-700);
  }
}

.hero-services-stack {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  width: 100%;
  justify-self: stretch;
}

.hero-service-card {
  position: relative;
  display: block;
  flex: 1;
  height: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.3s ease;
  box-shadow: 0 20px 40px rgba(8, 12, 28, 0.4);
}

@media (min-width: 1024px) {
  .hero-services-stack {
    flex-direction: column;
    gap: 0.5rem;
  }

  .hero-service-card {
    flex: 0 0 auto;
    height: 198px;
  }

  .service-hero-overlay {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
  }

  .service-hero-overlay h2 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
  }

  .service-hero-cta {
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
}

.hero-service-card:hover {
  transform: translateY(-4px);
  z-index: 1;
}

.hero-service-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

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

.section .hero-copy {
  max-width: 720px;
}

.services {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-items: start;
}

.service-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.service-card-link:hover .service-card {
  border-color: var(--sky);
  box-shadow: 0 32px 60px rgba(56, 189, 248, 0.25), 0 0 0 1px rgba(56, 189, 248, 0.3);
}

@media (prefers-color-scheme: light) {
  .service-card-link:hover .service-card {
    border-color: var(--sky);
    box-shadow: 0 32px 60px rgba(14, 165, 233, 0.15), 0 0 0 1px rgba(14, 165, 233, 0.3);
  }
}

.service-card-link:hover .card-footer {
  color: var(--sky);
}

.service-card {
  background: rgba(4, 9, 24, 0.75);
  border-radius: var(--radius-lg);
  padding: clamp(1.8rem, 3vw, 2.4rem);
  border: 1px solid rgba(148, 163, 184, 0.25);
  display: grid;
  gap: 1.25rem;
  box-shadow: 0 24px 45px rgba(4, 9, 24, 0.35);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

@media (prefers-color-scheme: light) {
  .service-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(100, 116, 139, 0.25);
    box-shadow: 0 24px 45px rgba(15, 23, 42, 0.12);
  }
}

.service-card img {
  border-radius: var(--radius-md);
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 300px;
}

.service-meta {
  display: grid;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.78);
}

@media (prefers-color-scheme: light) {
  .service-meta {
    color: var(--slate-600);
  }
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-weight: 600;
  color: var(--emerald);
}

.highlights-grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.highlight-card {
  background: rgba(4, 9, 24, 0.7);
  border-radius: var(--radius-md);
  padding: clamp(1.6rem, 2.6vw, 2.1rem);
  border: 1px solid rgba(148, 163, 184, 0.2);
  display: grid;
  gap: 0.75rem;
}

@media (prefers-color-scheme: light) {
  .highlight-card {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(100, 116, 139, 0.2);
    color: var(--slate-700);
  }
}

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

.gallery figure {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

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

.testimonials {
  display: grid;
  gap: clamp(1.2rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.testimonial-card {
  background: rgba(4, 9, 24, 0.75);
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.22);
  padding: clamp(1.6rem, 2.6vw, 2.2rem);
  display: grid;
  gap: 1rem;
}

@media (prefers-color-scheme: light) {
  .testimonial-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(100, 116, 139, 0.25);
    color: var(--slate-700);
  }
}

.testimonial-author {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: rgba(226, 232, 240, 0.78);
}

@media (prefers-color-scheme: light) {
  .testimonial-author {
    color: var(--slate-600);
  }
}

.cta-panel {
  background: #047857;
  border-radius: 12px;
  padding: clamp(2rem, 4vw, 3rem);
  display: grid;
  gap: 1.25rem;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.cta-panel .btn {
  background: #fff;
  color: var(--emerald);
  border-color: #fff;
}

.cta-panel .btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

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

  .metrics {
    justify-content: flex-start;
  }

  .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 520px) {
  .metric-card {
    flex: 1 1 calc(50% - 0.75rem);
    justify-content: center;
  }

  /* Fix service card text wrapping on mobile */
  .service-hero-overlay h2 {
    font-size: 1rem !important;
    white-space: nowrap;
  }

  .service-hero-cta {
    font-size: 0.8rem;
    padding: 0.5rem 1.2rem;
    white-space: nowrap;
  }

  /* Move pills and paragraph below service images on mobile */
  .hero-grid {
    display: flex;
    flex-direction: column;
  }

  .hero-copy {
    order: 1;
  }

  .hero-services-stack {
    order: 0;
  }

  /* Fix hero title wrapping - make it balanced */
  .hero-title {
    max-width: 100%;
    text-wrap: balance;
  }
}

/* Service Overlay Styles (used in hero-service-card) */
.service-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0.4) 50%,
    rgba(0, 0, 0, 0.7) 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem;
  transition: background 0.3s ease;
}

.hero-service-card:hover .service-hero-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.2) 0%,
    rgba(0, 0, 0, 0.5) 50%,
    rgba(0, 0, 0, 0.8) 100%
  );
}

.service-hero-overlay h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: white;
  margin: 0;
  text-align: center;
  letter-spacing: -0.02em;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.service-hero-cta {
  padding: 0.6rem 1.5rem;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  font-weight: 700;
  color: #0f172a;
  background: var(--emerald);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.4);
  text-shadow: none;
}

.service-hero-cta:hover {
  background: #22c55e;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(34, 197, 94, 0.5);
}
