/* JP Electrical — single page starter (desktop + mobile responsive)
   Replace content, phone/email/address and add real certifications as needed. */
/* Test auto update */
:root{
  --bg: #071a2c;
  --bg2:#0a223a;
  /* removed unused variables: --panel, --border */
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.70);
  --muted2: rgba(255,255,255,0.55);

  --cyan: #68c7e5;
  --blue: #3f89d8;
  --shadow: 0 18px 60px rgba(0,0,0,0.35);
  --radius: 18px;
  --radius2: 22px;
}

*{ box-sizing: border-box; }
body{
  margin:0;
  position: relative; /* allow ::before to cover full page */
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  /* base linear gradient as a fallback/background */
  background: linear-gradient(180deg, var(--bg), var(--bg2));
  line-height: 1.6;
}

.section, .section-alt{
  position: relative;
  /* create an isolated stacking context so section::before (negative z-index)
     can't bleed above or overlap neighbouring sections/page background */
  isolation: isolate;
}

.section::before{
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1; /* behind section content, above body::before which is -2 */
  pointer-events: none;
  /* subtle full-section surface to separate content from the decorative page background */
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.00));
}

img{ max-width:100%; display:block; }
a{ color: inherit; text-decoration:none; }
.container{
  width:min(1140px, calc(100% - 40px));
  margin-inline:auto;
}

.skip-link{
  position:absolute;
  left:-999px;
  top:12px;
  background:#fff;
  color:#000;
  padding:10px 14px;
  border-radius:10px;
  z-index:1000;
}
.skip-link:focus{ left:12px; }

/* Header */
.site-header{
  position:sticky;
  top:0;
  z-index:999;
  background: rgba(6, 18, 32, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  /* Reduced vertical padding so the logo has less surrounding whitespace */
  padding:8px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: auto;
}
.brand-mark{
  /* Use a larger fixed height to make the logo more readable on desktop */
  height:80px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.35));
}
/* removed unused brand text helpers (logo-only header used) */

/* Nav (desktop defaults) */
.nav{
  display:flex;
  align-items:center;
  gap:18px;
}
.nav a{
  font-weight:600;
  font-size: 14px;
  color: var(--muted);
  padding:10px 12px;
  border-radius: 12px;
  transition: 160ms ease;
}
.nav a:hover{
  color: var(--text);
  background: rgba(255,255,255,0.06);
}
.nav-cta{
  color: #041220 !important;
  background: linear-gradient(90deg, var(--cyan), #9fe6ff, var(--blue));
  box-shadow: 0 12px 30px rgba(104,199,229,0.22);
}

.nav-toggle{
  display:none;
  appearance:none;
  border:0;
  background: transparent;
  width:44px;
  height:44px;
  border-radius: 14px;
  cursor:pointer;
}
.nav-toggle:hover{ background: rgba(255,255,255,0.06); }
.nav-toggle span{
  display:block;
  height:2px;
  width:22px;
  margin:5px auto;
  background: rgba(255,255,255,0.88);
  border-radius: 2px;
}

/* Backdrop for mobile menu */
.nav-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: 160ms ease;
  z-index: 998;
}

/* Sections */
.section{ padding: 72px 0; }
.section-alt{
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00));
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.section h2{
  font-size: 36px;
  line-height: 1.2;
  margin:0 0 14px;
}
.lead{ font-size: 18px; color: var(--muted); margin-top: 0; }
.muted{ color: var(--muted2); }
.center{ display:flex; justify-content:center; margin-top: 26px; }
/* .fineprint removed (unused) */

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-weight:700;
  font-size: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  transition: 160ms ease;
  cursor:pointer;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,0.09); }
.btn.primary{
  color: #041220;
  border: 0;
  background: linear-gradient(90deg, var(--cyan), #9fe6ff, var(--blue));
  box-shadow: 0 14px 36px rgba(104,199,229,0.20);
}
.btn.ghost{ background: rgba(255,255,255,0.04); }
.btn.full{ width: 100%; }

/* Hero */
.hero{ padding: 74px 0 40px; }
.hero-grid{
  display:grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 44px;
  align-items:center;
}
.kicker{
  display:inline-flex;
  align-items:center;
  gap:10px;
  color: var(--muted);
  margin:0 0 14px;
  font-weight: 600;
}
.hero h1{
  font-size: 56px;
  line-height: 1.04;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}
.subhead{ margin: 0 0 22px; color: var(--muted); max-width: 52ch; }
.hero-actions{ display:flex; gap: 12px; flex-wrap: wrap; }
.trust-row{ display:flex; flex-wrap:wrap; gap:10px; margin-top: 18px; }
.pill{
  font-size: 13px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 8px 10px;
  border-radius: 999px;
}

.hero-media{ position: relative; }
.hero-card{
  border-radius: var(--radius2);
  overflow:hidden;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  box-shadow: var(--shadow);
}
.hero-card-top{ display:none; } /* removed unused markup; kept rule to avoid layout shifts if re-enabled */
.dot{ display:none; }
.hero-card img{ width:100%; height: 420px; object-fit: cover; opacity: 0.98; }
.glow{
  position:absolute;
  inset: -40px -30px -30px -30px;
  background:
    radial-gradient(280px 200px at 20% 25%, rgba(104,199,229,0.22), transparent 60%),
    radial-gradient(260px 220px at 78% 30%, rgba(63,137,216,0.18), transparent 60%);
  filter: blur(10px);
  z-index:-1;
}

/* About split + why card */
.split{
  display:grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items:start;
}
.about-points{ margin-top: 24px; display:grid; gap: 14px; }
.point{
  display:flex;
  gap: 12px;
  align-items:flex-start;
  padding: 14px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
}
.point .icon{
  width: 38px;
  height: 38px;
  display:grid;
  place-items:center;
  border-radius: 14px;
  background: rgba(104,199,229,0.10);
  border: 1px solid rgba(104,199,229,0.18);
}
.point h3{ margin:0; font-size: 16px; }
.point p{ margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.why-card{
  padding: 22px 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  position: sticky;
  top: 92px;
}
.why-card h3{ margin:0 0 12px; }
.ticks{
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display:grid;
  gap: 10px;
}
.ticks li{
  position: relative;
  padding-left: 26px;
  color: var(--muted);
}
.ticks li::before{
  content: "✔";
  position:absolute;
  left:0;
  top:0;
  color: rgba(159,230,255,0.95);
}

/* Services cards */
.section-head{
  text-align:center;
  max-width: 60ch;
  margin: 0 auto 28px;
}
.section-head p{ color: var(--muted); margin: 0; }
.cards{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* Examples / sample work grid */
.examples-grid{
  display:grid;
  /* larger min width so images display bigger before wrapping */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  /* use padding instead of margin to avoid margin-collapsing with the parent container
     so the section background expands correctly to contain the grid */
  padding: 18px 0 18px 0;
}
.examples-card{
  background: linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.06);
  /* slightly larger radius for a softer card */
  border-radius: var(--radius);
  overflow: hidden;
  text-align: left;
  box-shadow: 0 8px 26px rgba(0,0,0,0.16);
  transition: transform 160ms ease, box-shadow 160ms ease;
  aspect-ratio: 4 / 3;
  position: relative;
  display: block;
}
.examples-card:hover{ transform: translateY(-4px); box-shadow: 0 14px 36px rgba(0,0,0,0.22); }
.examples-card img{ width:100%; height:100%; object-fit:cover; display:block; opacity:0; transition: opacity 360ms ease; }
.examples-card img.loaded{ opacity:1; }
/* caption overlay to save vertical space and ensure card height accounts for content */
.examples-card figcaption{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* slightly reduced overlay opacity so image shows through more */
  background: linear-gradient(180deg, rgba(0,0,0,0.00), rgba(0,0,0,0.32));
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted2);
  /* Hidden by default; revealed when the parent has .show-caption or the button toggles aria-expanded */
  max-height: 0;
  opacity: 0;
  transform: translateY(6px);
  overflow: hidden;
  transition: opacity 200ms ease, transform 200ms ease, max-height 220ms ease;
  pointer-events: none;
}
.examples-card.show-caption figcaption,
.examples-card figcaption[aria-hidden="false"]{
  max-height: 240px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* info button in the top-right corner of each example card */
.examples-card .fig-info{
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.38);
  color: var(--text);
  display: grid;
  place-items: center;
  font-weight: 700;
  cursor: pointer;
  z-index: 6;
  transition: background 140ms ease, transform 120ms ease;
}
.examples-card .fig-info:hover{ background: rgba(0,0,0,0.48); transform: translateY(-1px); }
.examples-card .fig-info:focus{ outline: 3px solid rgba(159,230,255,0.22); outline-offset: 2px; }
.examples-card .fig-info[aria-expanded="true"]{ background: linear-gradient(90deg, rgba(104,199,229,0.14), rgba(63,137,216,0.12)); color: #041220; border-color: rgba(159,230,255,0.26); }
.examples-card figcaption a{ color: var(--muted); text-decoration: underline; }
.card{
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius2);
  padding: 18px 16px;
  box-shadow: 0 16px 46px rgba(0,0,0,0.24);
  transition: 180ms ease;
}
.card:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,0.07);
  border-color: rgba(159,230,255,0.20);
}
.card-icon{
  width: 44px;
  height: 44px;
  display:grid;
  place-items:center;
  border-radius: 16px;
  background: rgba(104,199,229,0.10);
  border: 1px solid rgba(104,199,229,0.18);
  margin-bottom: 10px;
  font-size: 20px;
}
.card h3{ margin:0 0 8px; font-size: 16px; }
.card p{ margin:0; color: var(--muted); font-size: 14px; }

/* Contact */
.contact-grid{
  display:grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 18px;
  align-items:start;
}
.contact-card, .form-card{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius2);
  padding: 22px 20px;
  box-shadow: var(--shadow);
}
.contact-list{ display:grid; gap: 10px; margin-top: 18px; }
.contact-item{
  display:flex;
  gap: 12px;
  align-items:center;
  padding: 12px 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}
.contact-item:hover{ background: rgba(255,255,255,0.06); }
.contact-ico{
  width: 40px;
  height: 40px;
  display:grid;
  place-items:center;
  border-radius: 16px;
  background: rgba(63,137,216,0.12);
  border: 1px solid rgba(63,137,216,0.18);
}
/* .note removed (unused) */

/* Form */
label{ display:block; }
label span{ display:block; font-size: 13px; color: var(--muted); margin: 0 0 8px; }
input, textarea, select{
  width: 100%;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0, 0, 0, 0.20);
  color: rgba(255,255,255,0.92);
  outline: none;
}
input::placeholder, textarea::placeholder{ color: rgba(255,255,255,0.40); }
input:focus, textarea:focus, select:focus{
  border-color: rgba(159,230,255,0.32);
  box-shadow: 0 0 0 4px rgba(104,199,229,0.12);
}

.form-row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.full{ margin-bottom: 12px; }
.checkbox{
  display:flex;
  align-items:center;
  gap: 10px;
  color: var(--muted);
  margin: 12px 0 14px;
}
.checkbox input{ width: 18px; height: 18px; }

/* Footer */
.footer{
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 28px 0;
  background: rgba(0,0,0,0.14);
}
.footer-inner{
  display:flex;
  gap: 18px;
  align-items:center;
  justify-content:space-between;
  flex-wrap: wrap;
}
.footer-left{ display:flex; align-items:center; gap: 0; }
.footer-mark{
  height:56px;
  width: auto;
  object-fit: contain;
  opacity: 0.95;
}
/* .footer-title and .footer-sub removed (footer uses image and links only) */
.footer-links{ display:flex; gap: 12px; flex-wrap: wrap; }
.footer-links a{
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 12px;
}
.footer-links a:hover{ color: var(--text); background: rgba(255,255,255,0.06); }

/* Responsive */
@media (max-width: 980px){
  .hero-grid{ grid-template-columns: 1fr; }
  .hero-card img{ height: 380px; }
  .split{ grid-template-columns: 1fr; }
  .why-card{ position: relative; top:auto; }
  .cards{ grid-template-columns: repeat(2, 1fr); }
  .contact-grid{ grid-template-columns: 1fr; }
}

@media (max-width: 720px){
  .container{ width: calc(100% - 28px); }
  .hero{ padding-top: 56px; }
  .hero h1{ font-size: 40px; }
  .section{ padding: 56px 0; }
  .section h2{ font-size: 30px; }

  /* Mobile nav */
  .nav-toggle{ display:inline-grid; place-items:center; }
  .nav{
    position: fixed;
    top: 70px;
    right: 14px;
    left: 14px;
    display:none;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(6, 18, 32, 0.96);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: var(--shadow);
    z-index: 999;
  }
  .nav a{ padding: 12px 12px; }
  .nav.open{ display:flex; }

  body.nav-open{ overflow: hidden; }
  body.nav-open .nav-backdrop{
    opacity: 1;
    pointer-events: auto;
  }

  .brand-tag{ display:none; }
  /* Slightly smaller logo on narrow viewports so header fits comfortably */
  .brand-mark{ height:48px; }
  .form-row{ grid-template-columns: 1fr; }
  .cards{ grid-template-columns: 1fr; }
  .hero-card img{ height: 280px; }
}

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; scroll-behavior:auto !important; }
  .btn:hover, .card:hover{ transform:none; }
}
