/* ==========================================================================
   Arcova Electric - Main Stylesheet
   --------------------------------------------------------------------------
   Mobile-first. Breakpoints:
     - 600px  : small tablets (2-column grids)
     - 768px  : tablet / desktop nav
     - 1024px : desktop (3-column grids, larger spacing)

   Table of contents
     1.  Design tokens (colors, spacing, fonts)
     2.  Base / reset
     3.  Layout helpers (.container, .section)
     4.  Buttons
     5.  Header & navigation
     6.  Hero
     7.  Services (+ cards injected by js/services.js)
     8.  About & badges
     9.  Service area
     10. Contact & form
     11. Footer
     12. Responsive breakpoints
     13. Reduced motion
   ========================================================================== */


/* ==========================================================================
   1. Design tokens
   Change brand colors here and they update site-wide.
   ========================================================================== */
:root {
  /* Brand palette (matches the logo) */
  --bg: #0b0b0c;                         /* page background */
  --bg-elev: #141416;                    /* raised surfaces: cards, alt sections */
  --text: #e8e8ea;                       /* main text */
  --muted: #a3a3a8;                      /* secondary text */
  --accent: #f28c1e;                     /* Arcova orange */
  --accent-glow: rgba(242, 140, 30, .35);/* orange glow for hovers/focus */
  --silver: #c9ccd1;                     /* silver from the logo */
  --border: #26262a;                     /* hairline borders */

  /* Status colors (contact form) */
  --error: #ff6b6b;
  --success: #4ade80;

  /* Typography: system UI stack, no web fonts */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --heading-tracking: .08em;             /* letter-spacing for uppercase headings */

  /* Layout */
  --container-max: 1140px;
  --gutter: 20px;                        /* side padding on .container */
  --section-pad: 64px;                   /* vertical section padding (mobile) */
  --header-h: 72px;
  --radius: 10px;
  --radius-sm: 6px;

  /* Motion */
  --transition: 180ms ease;

  color-scheme: dark;                    /* dark native form controls & scrollbars */
}


/* ==========================================================================
   2. Base / reset
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;              /* keeps anchored sections clear of the sticky header */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;                    /* safety net against horizontal scroll */
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1, h2, h3, h4 {
  margin: 0 0 .6em;
  line-height: 1.15;
  font-weight: 800;
  text-transform: uppercase;             /* echoes the logo lettering */
  letter-spacing: var(--heading-tracking);
  color: var(--text);
  overflow-wrap: break-word;
}

h1 { font-size: clamp(2rem, 7vw, 3.75rem); letter-spacing: .04em; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); }
h3 { font-size: 1.1rem; }

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--silver);
}

ul {
  margin: 0;
  padding: 0;
}

/* Visible keyboard focus for everything interactive */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--accent);
  color: var(--bg);
}


/* ==========================================================================
   3. Layout helpers
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--section-pad);
  background: var(--bg);
}

/* Alternate section backgrounds for visual rhythm.
   Order: services (bg) > about (elev) > service-area (bg) > contact (elev) */
.about,
.contact {
  background: var(--bg-elev);
  border-block: 1px solid var(--border);
}

/* Centered heading + intro used at the top of sections */
.section-header {
  max-width: 720px;
  margin: 0 auto 40px;
  text-align: center;
}

.section-header p {
  color: var(--muted);
  font-size: 1.05rem;
}

/* Small orange accent bar under section headings */
.section h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin-top: 16px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 12px var(--accent-glow);
}

.section-header h2::after {
  margin-inline: auto;
}

/* Small uppercase label above headings */
.eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--accent);
}


/* ==========================================================================
   4. Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
}

.btn:focus-visible {
  outline: 2px solid var(--silver);
  outline-offset: 3px;
}

/* Primary: orange fill, dark text */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.btn-primary:hover {
  background: #ff9d33;
  border-color: #ff9d33;
  color: var(--bg);
  box-shadow: 0 6px 24px var(--accent-glow);
  transform: translateY(-1px);
}

/* Secondary: silver outline */
.btn-secondary {
  background: transparent;
  border-color: var(--silver);
  color: var(--silver);
}

.btn-secondary:hover {
  background: var(--silver);
  color: var(--bg);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Keep a disabled primary button from lighting up on hover (e.g. while sending) */
.btn-primary[disabled]:hover,
.btn-primary[aria-disabled="true"]:hover {
  background: var(--accent);
  border-color: var(--accent);
}

/* Full-width button (used on the contact form) */
.btn-block {
  width: 100%;
}


/* ==========================================================================
   5. Header & navigation
   js/main.js toggles .is-open on .nav-menu and aria-expanded on .nav-toggle.
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 11, 12, .85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition), box-shadow var(--transition);
}

/* js/main.js adds .is-scrolled once the page is scrolled past the top */
.site-header.is-scrolled {
  background: rgba(11, 11, 12, .95);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--header-h);
}

/* Logo */
.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand img {
  height: 44px;                          /* mobile logo height (56px on desktop, see breakpoints) */
  width: auto;
  object-fit: contain;
}

/* Hamburger button (mobile only) */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition);
}

.nav-toggle:hover {
  border-color: var(--accent);
}

.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* Animate hamburger into an "X" when the menu is open */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu: hidden until .is-open, drops down below the header */
.nav-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  gap: 4px;
  padding: 12px var(--gutter) 20px;
  list-style: none;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 16px 32px rgba(0, 0, 0, .5);
}

.nav-menu.is-open {
  display: flex;
}

.nav-menu a:not(.btn) {
  display: block;
  padding: 12px 4px;
  color: var(--text);
  font-size: .9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  border-bottom: 1px solid var(--border);
}

.nav-menu a:not(.btn):hover {
  color: var(--accent);
}

.nav-cta {
  width: 100%;
  margin-top: 12px;
}


/* ==========================================================================
   6. Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: 88px 80px;
  background:
    radial-gradient(ellipse 60% 55% at 80% 20%, var(--accent-glow), transparent 70%),
    radial-gradient(ellipse 50% 40% at 10% 90%, rgba(242, 140, 30, .12), transparent 70%),
    linear-gradient(180deg, #111113 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

/* Faint grid texture for an "electrical blueprint" feel */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(201, 204, 209, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 204, 209, .04) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
  pointer-events: none;
}

.hero-inner {
  position: relative;                    /* sits above the ::before texture */
  max-width: var(--container-max);
}

.hero h1 {
  max-width: 16ch;
  margin-bottom: 20px;
}

.hero-sub {
  max-width: 60ch;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions .btn {
  flex: 1 1 200px;                       /* stack full-width on small phones */
}


/* ==========================================================================
   7. Services
   The .service-card markup is injected by js/services.js:
     <article class="service-card">
       <div class="service-icon"><svg>...</svg></div>
       <h3>Title</h3>
       <p>Description</p>
       <ul class="service-list"><li>...</li></ul>   (optional)
     </article>
   ========================================================================== */
.services-grid {
  display: grid;
  grid-template-columns: 1fr;            /* 1 col mobile, 2 tablet, 3 desktop */
  gap: 20px;
}

.service-card {
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
}

.service-card:hover,
.service-card:focus-within {
  border-color: rgba(242, 140, 30, .55);
  box-shadow: 0 0 0 1px rgba(242, 140, 30, .15), 0 10px 32px var(--accent-glow);
  transform: translateY(-3px);
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  color: var(--accent);                  /* SVGs should use currentColor */
  background: rgba(242, 140, 30, .08);
  border: 1px solid rgba(242, 140, 30, .25);
  border-radius: var(--radius-sm);
}

.service-icon svg {
  width: 40px;
  height: 40px;
  padding: 4px;
  stroke: currentColor;
}

.service-card h3 {
  margin-bottom: 10px;
}

.service-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.service-list {
  margin-top: 16px;
  padding-top: 16px;
  list-style: none;
  border-top: 1px solid var(--border);
}

.service-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 6px;
  color: var(--text);
  font-size: .95rem;
}

/* Orange "spark" bullet */
.service-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .6em;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent-glow);
}


/* ==========================================================================
   8. About & badges
   ========================================================================== */
.about-inner {
  display: grid;
  gap: 40px;
}

.about-text p {
  color: var(--muted);
  font-size: 1.05rem;
}

.badges {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  list-style: none;
}

.badge {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

.badge-title {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--heading-tracking);
  color: var(--silver);
}

.badge-text {
  color: var(--muted);
  font-size: .95rem;
}


/* ==========================================================================
   9. Service area
   ========================================================================== */
.area-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 900px;
  margin-inline: auto;
  list-style: none;
}

.area-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
  transition: border-color var(--transition);
}

.area-list li:hover {
  border-color: rgba(242, 140, 30, .55);
}

/* Orange map-pin dot */
.area-list li::before {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-glow);
}


/* ==========================================================================
   10. Contact & form
   js/main.js adds .is-error or .is-success to #form-status.
   ========================================================================== */
.contact-inner {
  display: grid;
  gap: 40px;
}

.contact-info > p {
  color: var(--muted);
  font-size: 1.05rem;
}

.contact-details {
  display: grid;
  gap: 16px;
  margin-top: 24px;
  list-style: none;
}

.contact-details li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-label {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--muted);
}

.contact-details a,
.contact-details span:not(.contact-label) {
  font-size: 1.15rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.contact-details span:not(.contact-label) {
  color: var(--text);
}

.contact-form {
  position: relative;                    /* contains the absolutely-positioned honeypot */
  display: grid;
  gap: 18px;
  padding: 24px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.form-grid {
  display: grid;
  gap: 18px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--silver);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 1rem;                       /* 16px+ prevents iOS zoom on focus */
  transition: border-color var(--transition), box-shadow var(--transition);
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

/* Custom dropdown arrow for the select */
.contact-form select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f28c1e' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #6b6b70;
}

.contact-form input:hover,
.contact-form select:hover,
.contact-form textarea:hover {
  border-color: #3a3a40;
}

/* Orange focus ring */
.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Invalid state (applies after the user has interacted, or if JS sets aria-invalid) */
.contact-form [aria-invalid="true"] {
  border-color: var(--error);
}

/* Honeypot anti-spam field: visually removed but present in the DOM */
.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Status message under the submit button */
.form-status {
  min-height: 1.5em;
  margin: 0;
  font-size: .95rem;
  color: var(--muted);
}

.form-status:empty {
  min-height: 0;
}

.form-status.is-error {
  color: var(--error);
}

.form-status.is-success {
  color: var(--success);
}


/* ==========================================================================
   11. Footer
   ========================================================================== */
.site-footer {
  padding-block: 48px 32px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer-brand img {
  height: 64px;
  width: auto;
  object-fit: contain;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  list-style: none;
}

.footer-nav a {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-tagline {
  margin: 0;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .25em;
  color: var(--accent);
}

.footer-copy {
  margin: 0;
  font-size: .85rem;
  color: var(--muted);
}


/* ==========================================================================
   12. Responsive breakpoints
   ========================================================================== */

/* Small tablets */
@media (min-width: 600px) {
  :root {
    --gutter: 24px;
  }

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

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

  .area-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .contact-form {
    padding: 32px;
  }

  .hero-actions .btn {
    flex: 0 0 auto;
  }
}

/* Tablet and up: inline navigation, hide hamburger */
@media (min-width: 768px) {
  .brand img {
    height: 56px;
  }

  .nav-toggle {
    display: none;
  }

  .nav-menu,
  .nav-menu.is-open {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
  }

  .nav-menu a:not(.btn) {
    padding: 8px 12px;
    font-size: .8rem;
    border-bottom: 0;
  }

  .nav-cta {
    width: auto;
    min-height: 40px;
    margin: 0 0 0 8px;
    padding: 8px 16px;
    font-size: .8rem;
  }

  .hero {
    padding-block: 128px 112px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  :root {
    --section-pad: 96px;
    --header-h: 80px;
  }

  .services-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }

  .about-inner {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: 64px;
  }

  .area-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .contact-inner {
    grid-template-columns: 1fr 1.3fr;
    align-items: start;
    gap: 64px;
  }

  .hero {
    padding-block: 160px 144px;
  }

  .nav-menu a:not(.btn) {
    font-size: .85rem;
    padding: 8px 14px;
  }
}


/* ==========================================================================
   13. Reduced motion
   Respect users who prefer less animation.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .btn:hover,
  .service-card:hover,
  .service-card:focus-within {
    transform: none;
  }
}
