/* MJP Electrical Services — Design System */

:root {
  /* Signal: black bar, white page, green from the logo. */
  --navy-950: #0a0a0a;
  --navy-900: #111111;
  --navy-800: #1a1a1a;
  --navy-700: #334155;
  --amber-500: #4ec83c;
  --amber-400: #7dff6a;
  --amber-600: #157a16;
  --sky-400: #4ec83c;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --success: #22c55e;
  --error: #ef4444;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "DM Sans", var(--font-sans);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --max-width: 1200px;
  --header-height: 4.5rem;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--navy-800);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button, input, textarea, select {
  font: inherit;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy-900);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }

p + p { margin-top: 1rem; }

.text-amber { color: var(--amber-500); }
.text-muted { color: var(--gray-600); }

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section {
  padding: 5rem 0;
}

.section--gray {
  background: var(--gray-50);
}

.section--dark {
  background: var(--navy-900);
  color: var(--white);
}

.section--dark h2,
.section--dark h3 {
  color: var(--white);
}

.section-header {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto 3rem;
}

.section-header p {
  margin-top: 0.75rem;
  color: var(--gray-600);
  font-size: 1.125rem;
}

.section--dark .section-header p {
  color: var(--gray-400);
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.3s;
}

.site-header.scrolled {
  box-shadow: var(--shadow-lg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  gap: 1.5rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.logo img, .logo svg {
  width: auto;
  height: 2.75rem;
}

.logo-lockup img {
  width: 13.5rem;
  height: auto;
}

.logo span {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo small {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--amber-400);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.nav-desktop a {
  color: rgba(255, 255, 255, 0.85);
  padding: 0.5rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.nav-phone {
  display: none;
  align-items: center;
  gap: 0.5rem;
  background: var(--amber-500);
  color: var(--navy-950);
  padding: 0.625rem 1.25rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.9375rem;
  transition: background 0.2s, transform 0.2s;
  white-space: nowrap;
}

.nav-phone:hover {
  background: var(--amber-400);
  transform: scale(1.02);
}

.nav-phone svg {
  width: 1.125rem;
  height: 1.125rem;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--navy-900);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 99;
}

.nav-mobile.open {
  display: block;
}

.nav-mobile a {
  display: block;
  color: var(--white);
  padding: 1rem 0;
  font-size: 1.125rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-mobile .nav-phone-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  background: var(--amber-500);
  color: var(--navy-950);
  padding: 1rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1.125rem;
  border: none;
}

@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .nav-phone { display: flex; }
  .menu-toggle { display: none; }
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.88) 0%,
    rgba(0, 0, 0, 0.62) 45%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 3rem 0 4rem;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero-text h1 {
  color: var(--white);
  margin-bottom: 1rem;
}

.hero-text h1 .highlight {
  color: var(--amber-400);
}

.hero-text .tagline {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1.0625rem, 2vw, 1.25rem);
  margin-bottom: 1.5rem;
  max-width: 32rem;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--white);
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.badge svg {
  width: 1rem;
  height: 1rem;
  color: var(--amber-400);
}

.hero-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  font-family: var(--font-display);
  transition: color 0.2s;
}

.hero-phone:hover {
  color: var(--amber-400);
}

.hero-phone svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--amber-500);
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr 420px;
    gap: 3rem;
  }
}

/* Contact Form */
.contact-form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-xl);
}

.contact-form-card h2 {
  font-size: 1.375rem;
  margin-bottom: 0.25rem;
}

.contact-form-card > p {
  color: var(--gray-600);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy-800);
  margin-bottom: 0.375rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 0.5rem;
  background: var(--gray-50);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--amber-500);
  box-shadow: 0 0 0 3px rgba(78, 200, 60, 0.22);
  background: var(--white);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  gap: 1rem;
}

@media (min-width: 500px) {
  .form-row { grid-template-columns: 1fr 1fr; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: var(--amber-500);
  color: var(--navy-950);
  width: 100%;
}

.btn-primary:hover {
  background: var(--amber-400);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn-outline:hover {
  border-color: var(--amber-400);
  color: var(--amber-400);
}

.btn-dark {
  background: var(--navy-900);
  color: var(--white);
}

.btn-dark:hover {
  background: var(--navy-800);
}

.form-status {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  display: none;
}

.form-status.success {
  display: block;
  background: #dcfce7;
  color: #166534;
}

.form-status.error {
  display: block;
  background: #fee2e2;
  color: #991b1b;
}

/* Services Grid */
.services-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

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

@media (min-width: 900px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); }
}

.service-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.service-card__image {
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.service-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.service-card:hover .service-card__image img {
  transform: scale(1.05);
}

.service-card__body {
  padding: 1.5rem;
}

.service-card__body h3 {
  margin-bottom: 0.5rem;
}

.service-card__body p {
  color: var(--gray-600);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

.service-card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--amber-600);
  font-weight: 600;
  font-size: 0.9375rem;
}

.service-card__link svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.2s;
}

.service-card:hover .service-card__link svg {
  transform: translateX(4px);
}

/* Accreditations */
.accreditations-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 700px) {
  .accreditations-grid { grid-template-columns: repeat(4, 1fr); }
}

.accreditation-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.accreditation-card:hover {
  border-color: var(--amber-500);
  box-shadow: var(--shadow-md);
}

.accreditation-card img,
.accreditation-card svg {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 0.75rem;
}

.accreditation-card h4 {
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.accreditation-card p {
  font-size: 0.75rem;
  color: var(--gray-600);
}

/* Why Choose Us */
.features-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 700px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}

.feature-item {
  text-align: center;
  padding: 1.5rem;
}

.feature-icon {
  width: 3.5rem;
  height: 3.5rem;
  background: rgba(78, 200, 60, 0.16);
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.feature-icon svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--amber-500);
}

.feature-item h3 {
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

.feature-item p {
  color: var(--gray-600);
  font-size: 0.9375rem;
}

/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--white);
}

.cta-banner h2 {
  color: var(--white);
  margin-bottom: 0.75rem;
}

.cta-banner p {
  color: var(--gray-400);
  margin-bottom: 1.5rem;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

.cta-banner .btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Page Hero (sub-pages) */
.page-hero {
  position: relative;
  padding: calc(var(--header-height) + 4rem) 0 4rem;
  background: var(--navy-900);
  color: var(--white);
  overflow: hidden;
}

.page-hero--image .page-hero-bg {
  position: absolute;
  inset: 0;
}

.page-hero--image .page-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero--image .page-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.55) 100%);
}

.page-hero-content {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  color: var(--white);
  margin-bottom: 0.75rem;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.125rem;
  max-width: 40rem;
}

.breadcrumb {
  display: flex;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-400);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--amber-400);
}

.breadcrumb a:hover {
  text-decoration: underline;
}

/* Service Page Content */
.content-grid {
  display: grid;
  gap: 3rem;
  align-items: start;
}

@media (min-width: 800px) {
  .content-grid {
    grid-template-columns: 1fr 1fr;
  }

  .content-grid--reverse .content-grid__image {
    order: 2;
  }
}

.content-grid__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.content-grid__text h2 {
  margin-bottom: 1rem;
}

.content-grid__text ul {
  list-style: none;
  margin: 1.5rem 0;
}

.content-grid__text li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--gray-600);
}

.content-grid__text li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--amber-500);
  border-radius: 50%;
}

/* About */
.about-intro {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 800px) {
  .about-intro {
    grid-template-columns: 300px 1fr;
  }
}

.about-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.about-photo img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

/* Contact Page */
.contact-grid {
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 800px) {
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contact-info-card {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--gray-200);
}

.contact-info-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-info-item:last-child {
  margin-bottom: 0;
}

.contact-info-item svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--amber-500);
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.contact-info-item h4 {
  font-size: 0.875rem;
  color: var(--gray-600);
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.contact-info-item a,
.contact-info-item p {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--navy-900);
}

.contact-info-item a:hover {
  color: var(--amber-600);
}

.service-area-map {
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.service-area-map iframe {
  width: 100%;
  height: 300px;
  border: 0;
  display: block;
}

/* Gallery */
.gallery-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 700px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

.gallery-grid img {
  border-radius: var(--radius);
  aspect-ratio: 4/3;
  object-fit: cover;
  width: 100%;
}

/* Footer */
.site-footer {
  background: var(--navy-950);
  color: rgba(255, 255, 255, 0.7);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

.footer-brand .logo {
  margin-bottom: 1rem;
}

.footer-brand p {
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: 20rem;
}

.footer-col h4 {
  color: var(--white);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  padding: 0.375rem 0;
  font-size: 0.9375rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: var(--amber-400);
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  transition: background 0.2s;
}

.footer-social a:hover {
  background: var(--amber-500);
}

.footer-social svg {
  width: 1.25rem;
  height: 1.25rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}

.footer-bottom a {
  color: var(--amber-400);
}

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

/* Utilities */
.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;
}

.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }
/* Markdown from the editor uses the same column as the hand-written pages. */
.content-grid__text p { margin-bottom: 1rem; }
.content-grid__text h3 { margin: 1.25rem 0 0.5rem; font-size: 1.25rem; }
.content-grid__text .btn { margin-top: 0.5rem; }
