/* ===========================================================
   Harbor Electrical Services — Demo Build
   Token system:
   Color    --bg #15140f, --surface #1f1d16, --text #f4f1e8,
            --muted #a8a397, --gold #f2b705, --ember #d9491f
   Type     Display: Fraunces / Body: Inter / Labels: IBM Plex Mono
   Signature: animated current-trace divider between sections
   =========================================================== */

   :root {
    --bg: #15140f;
    --surface: #1f1d16;
    --surface-2: #28251c;
    --text: #f4f1e8;
    --muted: #a8a397;
    --gold: #f2b705;
    --ember: #d9491f;
    --line: rgba(244, 241, 232, 0.1);
    --radius: 14px;
  }
  
  * { box-sizing: border-box; }
  
  html { scroll-behavior: smooth; }
  
  body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }
  
  img { max-width: 100%; display: block; }
  
  a { color: inherit; text-decoration: none; }
  
  h1, h2, h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    line-height: 1.1;
    margin: 0;
  }
  
  .eyebrow {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
  }
  
  .wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
  }
  
  /* Skip link */
  .skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--gold);
    color: #15140f;
    padding: 10px 16px;
    z-index: 100;
  }
  .skip-link:focus { left: 12px; top: 12px; }
  
  /* Header */
  header.site {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(21, 20, 15, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
  .nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: 1120px;
    margin: 0 auto;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Fraunces', serif;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
  }
  .brand svg { width: 26px; height: 26px; }
  .brand-logo { width: 30px; height: 30px; object-fit: contain; border-radius: 50%; }
  .nav-links { display: flex; gap: 28px; align-items: center; }
  .nav-links a {
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    color: var(--muted);
  }
  .nav-links a:hover, .nav-links a:focus-visible { color: var(--gold); }
  .nav-cta {
    background: var(--gold);
    color: #15140f !important;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.82rem;
  }
  .nav-cta:hover { background: #ffce2b; }

  .nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
  }
  .nav-toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    margin: 0 auto;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .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);
  }
  
  /* Base hero (used plain on About page; .hero-photo above overrides for the home page) */
  .hero {
    position: relative;
    padding: 96px 0 60px;
    overflow: hidden;
    background:
      radial-gradient(ellipse 60% 50% at 80% 0%, rgba(242,183,5,0.10), transparent 60%),
      var(--bg);
  }
  .hero .eyebrow { margin-bottom: 18px; }
  .hero h1 {
    font-size: clamp(2.4rem, 4.6vw, 3.6rem);
    color: var(--text);
  }
  .hero h1 em {
    font-style: normal;
    color: var(--gold);
  }
  .hero p.lede {
    margin-top: 22px;
    max-width: 480px;
    color: var(--muted);
    font-size: 1.05rem;
  }
  .badge-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 28px;
  }
  .badge {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 7px 14px;
  }
  .hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
  
  .btn {
    display: inline-block;
    padding: 14px 26px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92rem;
    transition: transform 0.15s ease, background 0.15s ease;
  }
  .btn-primary { background: var(--gold); color: #15140f; }
  .btn-primary:hover { background: #ffce2b; transform: translateY(-1px); }
  .btn-ghost {
    border: 1px solid var(--line);
    color: var(--text);
  }
  .btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
  
  /* Hero with real background photo (home page) */
  .hero-photo {
    position: relative;
    padding: 0;
    min-height: 560px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: none;
  }
  .hero-photo-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: saturate(0.9);
  }
  .hero-photo-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, rgba(21,20,15,0.94) 0%, rgba(21,20,15,0.78) 42%, rgba(21,20,15,0.35) 75%, rgba(21,20,15,0.15) 100%);
  }
  .hero-photo-content {
    position: relative;
    z-index: 2;
    padding: 90px 24px;
    max-width: 680px;
  }
  .hero-photo-content h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); }
  .hero-photo-content .lede { max-width: 520px; }
  
  /* Stat strip below hero */
  .stat-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
  }
  .stat-row .stat {
    border-top: 1px solid var(--line);
    padding-top: 14px;
  }
  .stat .num {
    font-family: 'Fraunces', serif;
    font-size: 1.9rem;
    color: var(--gold);
    display: block;
  }
  .stat .label {
    color: var(--muted);
    font-size: 0.82rem;
  }
  
  /* Testimonial photo */
  .t-photo-wrap {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    min-height: 260px;
  }
  .t-photo {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    object-position: center;
    display: block;
  }
  
  /* About page alternating sections */
  .alt-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 56px;
    align-items: center;
  }
  .alt-row-reverse .alt-text { order: 2; }
  .alt-row-reverse .alt-photo { order: 1; }
  .alt-text p { color: var(--muted); margin-top: 16px; font-size: 0.98rem; }
  .alt-text h2 { margin-top: 10px; font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
  .alt-photo img {
    border-radius: var(--radius);
    border: 1px solid var(--line);
    width: 100%;
    height: 340px;
    object-fit: cover;
  }
  @media (max-width: 880px) {
    .alt-row, .alt-row-reverse { grid-template-columns: 1fr; }
    .alt-row-reverse .alt-text, .alt-row-reverse .alt-photo { order: initial; }
  }
  
  /* Current trace divider — signature element */
  .current-trace {
    width: 100%;
    height: 48px;
    display: block;
  }
  .current-trace path {
    fill: none;
    stroke: var(--line);
    stroke-width: 1.5;
  }
  .current-trace circle {
    fill: var(--gold);
    filter: drop-shadow(0 0 6px rgba(242,183,5,0.9));
  }
  @keyframes travel {
    0% { offset-distance: 0%; }
    100% { offset-distance: 100%; }
  }
  .current-trace .pulse {
    offset-path: path("M0,24 C 140,4 280,44 420,24 S 700,4 840,24 S 1120,44 1260,24");
    animation: travel 6s linear infinite;
  }
  @media (prefers-reduced-motion: reduce) {
    .current-trace .pulse { animation: none; offset-distance: 40%; }
  }
  
  /* Section base */
  section { padding: 88px 0; }
  .section-head { max-width: 620px; margin-bottom: 52px; }
  .section-head h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-top: 10px; }
  .section-head p { color: var(--muted); margin-top: 14px; }
  
  /* Services */
  .service-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }
  .service-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s ease, transform 0.2s ease;
  }
  .service-card:hover { border-color: rgba(242,183,5,0.4); transform: translateY(-3px); }
  .service-card img { height: 170px; width: 100%; object-fit: cover; }
  .service-card .body { padding: 20px; }
  .service-card h3 { font-size: 1.15rem; }
  .service-card p { color: var(--muted); font-size: 0.9rem; margin-top: 8px; }
  
  /* About / values strip */
  .values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }
  .value-item {
    border-top: 2px solid var(--gold);
    padding-top: 16px;
  }
  .value-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
  .value-item p { color: var(--muted); font-size: 0.92rem; }
  
  /* Testimonials */
  .testimonial-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }
  .t-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .t-card blockquote {
    margin: 0;
    padding: 22px 22px 0;
    font-size: 0.95rem;
    color: var(--text);
    flex: 1;
  }
  .t-card .who {
    margin-top: 18px;
    padding: 0 22px 22px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gold);
  }
  
  /* Service area */
  .area-strip {
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .area-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
  }
  .area-pill {
    font-size: 0.82rem;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 14px;
  }
  
  /* Contact / form */
  .contact-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 48px;
  }
  .contact-info h2 { font-size: clamp(1.8rem, 3vw, 2.3rem); }
  .contact-info p { color: var(--muted); margin-top: 14px; }
  .contact-detail {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .contact-detail .row { display: flex; gap: 12px; align-items: flex-start; }
  .contact-detail .row svg { flex-shrink: 0; margin-top: 3px; color: var(--gold); }
  .contact-detail .row a, .contact-detail .row span { color: var(--text); font-size: 0.95rem; }
  .contact-detail .email-list { display: flex; flex-direction: column; gap: 6px; }
  
  .form-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
  }
  .form-card .panel-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 18px;
  }
  .field { margin-bottom: 16px; }
  .field label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 6px;
  }
  .field input, .field select, .field textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease;
  }
  .field input:focus, .field select:focus, .field textarea:focus {
    border-color: var(--gold);
  }
  .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  textarea { resize: vertical; min-height: 110px; }
  
  .form-submit {
    width: 100%;
    background: var(--gold);
    color: #15140f;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
  }
  .form-submit:hover:not(:disabled) { background: #ffce2b; }
  .form-submit:disabled { opacity: 0.6; cursor: not-allowed; }
  
  .form-note {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--muted);
  }
  .form-error {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--ember);
  }
  .success-state {
    text-align: center;
    padding: 30px 10px;
  }
  .success-state svg { margin: 0 auto 16px; }
  .success-state h3 { font-size: 1.3rem; }
  .success-state p { color: var(--muted); margin-top: 8px; }
  
  /* Footer */
  footer.site {
    border-top: 1px solid var(--line);
    padding: 40px 0;
  }
  .footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
  }
  .footer-row .left { display: flex; align-items: center; gap: 10px; font-family: 'Fraunces', serif; font-size: 0.95rem; }
  .footer-row .left svg { width: 20px; height: 20px; }
  .social-row { display: flex; gap: 14px; }
  .social-row a {
    width: 36px; height: 36px;
    border: 1px solid var(--line);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted);
    transition: border-color 0.15s ease, color 0.15s ease;
  }
  .social-row a:hover { border-color: var(--gold); color: var(--gold); }
  .fine-print { color: var(--muted); font-size: 0.78rem; margin-top: 22px; }
  
  /* Responsive */
  @media (max-width: 880px) {
    .hero-grid { grid-template-columns: 1fr; }
    .stat-row { grid-template-columns: 1fr 1fr; }
    .service-grid, .testimonial-grid, .values { grid-template-columns: 1fr 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .nav { flex-wrap: wrap; position: relative; }
    .nav-toggle { display: flex; }
    .nav-links {
      display: none;
      width: 100%;
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      padding: 8px 0 12px;
      border-top: 1px solid var(--line);
      margin-top: 12px;
    }
    .nav-links.is-open { display: flex; }
    .nav-links a {
      padding: 12px 0;
      font-size: 0.95rem;
    }
    .nav-cta {
      margin-top: 8px;
      text-align: center;
    }
  }
  @media (max-width: 560px) {
    .service-grid, .testimonial-grid, .values { grid-template-columns: 1fr; }
    .field-row { grid-template-columns: 1fr; }
    section { padding: 64px 0; }
    .hero { padding: 64px 0 80px; }
  }