/* ==========================================================================
   Electrafix (EA) Limited — Brand tokens: EF-BRD-001
   ========================================================================== */

:root {
  --navy: #0B1D3A;
  --navy-panel: #0F2547;
  --blue: #0B90FF;
  --blue-deep: #0870CC;
  --grey-dark: #424242;
  --grey: #6B6F76;
  --grey-light: #A6A6A6;
  --rule: #DCE2E9;
  --off-white: #F4F7FA;
  --white: #FFFFFF;

  --font-head: "Montserrat", "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", "Segoe UI", Arial, sans-serif;

  --maxw: 1180px;
  --gutter: clamp(20px, 5vw, 64px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--grey-dark);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-weight: 700; font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
h2 { font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-weight: 600; font-size: 1.2rem; }

p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-deep); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85em 1.6em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-deep); color: var(--white); }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-outline-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.5); }
.btn-outline-light:hover { border-color: var(--blue); color: var(--blue); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(6px);
  border-bottom: 1px solid var(--rule);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.brand { display: flex; align-items: center; gap: 0.6em; }
.brand img { height: 34px; width: auto; }

.nav { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 34px); }
.nav a {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--navy);
  padding: 0.4em 0.1em;
  position: relative;
}
.nav a:hover { color: var(--blue); }
.nav a.is-active { color: var(--blue); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--blue);
}
.nav .btn { margin-left: 8px; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* ---------- hero ---------- */
.hero {
  background: var(--off-white);
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  padding-top: clamp(48px, 8vw, 92px);
  padding-bottom: clamp(48px, 8vw, 92px);
}
.hero-copy p.lede {
  font-size: 1.1rem;
  color: var(--grey-dark);
  max-width: 46ch;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 1.6em;
}
.hero-art {
  position: relative;
}
.hero-art svg { width: 100%; height: auto; }

/* schematic draw-in, one orchestrated reveal, respects reduced motion */
.schematic-line {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 1.4s ease forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .schematic-line { animation: none; stroke-dashoffset: 0; }
}

/* ---------- credential strip ---------- */
.credentials {
  border-bottom: 1px solid var(--rule);
  background: var(--white);
}
.credentials .container {
  display: flex;
  flex-wrap: wrap;
  padding-top: 22px;
  padding-bottom: 22px;
}
.credentials ul {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0; padding: 0;
  width: 100%;
}
.credentials li {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--grey-dark);
  padding: 0 1.4em;
  border-left: 1px solid var(--rule);
}
.credentials li:first-child { border-left: none; padding-left: 0; }

/* ---------- sections ---------- */
section { padding-top: clamp(56px, 8vw, 100px); padding-bottom: clamp(56px, 8vw, 100px); }
.section-head { max-width: 62ch; margin-bottom: 2.2em; }
.section-head p { color: var(--grey-dark); }

.section-alt { background: var(--off-white); }

/* pull-note: brand statement callout */
.pull-note {
  border-left: 3px solid var(--blue);
  padding: 0.2em 0 0.2em 1.4em;
  margin: 0;
}
.pull-note p {
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--navy);
  max-width: 40ch;
  line-height: 1.4;
}

/* ---------- services schedule ---------- */
.schedule { width: 100%; border-collapse: collapse; }
.schedule caption { text-align: left; margin-bottom: 1em; }
.schedule-row {
  display: grid;
  grid-template-columns: minmax(180px, 300px) 1fr;
  gap: 24px;
  padding: 1.6em 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.schedule-row:last-child { border-bottom: 1px solid var(--rule); }
.schedule-row h3 {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin: 0;
}
.schedule-row h3::before {
  content: "";
  width: 7px; height: 7px;
  background: var(--blue);
  flex: none;
  display: inline-block;
}
.schedule-row p { margin: 0; color: var(--grey-dark); max-width: 56ch; }

.note-inline {
  margin-top: 2.4em;
  padding-top: 1.6em;
  border-top: 1px dashed var(--rule);
  color: var(--grey-dark);
}

/* ---------- workflow (real sequence) ---------- */
.workflow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--rule);
}
.workflow-step {
  flex: 1 1 180px;
  padding: 1.6em 1.4em;
  border-left: 1px solid var(--rule);
  position: relative;
}
.workflow-step:first-child { border-left: none; }
.workflow-step .idx {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.02em;
  margin-bottom: 0.6em;
  display: block;
}
.workflow-step h3 { font-size: 1rem; margin-bottom: 0.4em; }
.workflow-step p { font-size: 0.92rem; margin: 0; color: var(--grey); }
.workflow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -13px;
  top: 1.6em;
  color: var(--grey-light);
  background: var(--white);
  font-size: 1rem;
  z-index: 2;
}
@media (max-width: 760px) {
  .workflow { flex-direction: column; }
  .workflow-step { border-left: none; border-top: 1px solid var(--rule); }
  .workflow-step:first-child { border-top: none; }
  .workflow-step:not(:last-child)::after { content: "↓"; right: auto; left: 1.4em; top: auto; bottom: -13px; }
}

/* ---------- info grid (about page) ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.4em 2.8em;
}
@media (max-width: 700px) { .info-grid { grid-template-columns: 1fr; } }
.info-grid dt {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--navy);
  font-size: 0.95rem;
  margin-bottom: 0.3em;
}
.info-grid dd { margin: 0; color: var(--grey-dark); }

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--navy);
  color: var(--off-white);
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, rgba(11,144,255,0.5) 0, rgba(11,144,255,0.5) 1px, transparent 1px);
  background-size: 64px 100%;
  opacity: 0.12;
  pointer-events: none;
}
.cta-band .container {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: clamp(44px, 6vw, 64px);
  padding-bottom: clamp(44px, 6vw, 64px);
}
.cta-band h2 { color: var(--white); margin-bottom: 0.25em; }
.cta-band p { color: var(--grey-light); margin: 0; }
.cta-band .actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- contact page ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
}
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

.field { margin-bottom: 1.3em; }
.field label {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--navy);
  margin-bottom: 0.45em;
}
.field input, .field select, .field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--grey-dark);
  padding: 0.75em 0.9em;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: var(--white);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue);
  outline: none;
}
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 0.85rem; color: var(--grey); margin-top: 1em; }
.hp-field { position: absolute; left: -9999px; top: -9999px; }

.contact-detail { margin-bottom: 1.8em; }
.contact-detail dt {
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--navy);
  font-size: 0.88rem;
  margin-bottom: 0.3em;
}
.contact-detail dd { margin: 0; }

/* ---------- title-block footer ---------- */
.site-footer {
  background: var(--off-white);
  border-top: 1px solid var(--rule);
}
.title-block {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  border: 1px solid var(--navy);
  margin: 48px 0 28px;
}
.title-block > div {
  padding: 1.3em 1.5em;
  border-left: 1px solid var(--rule);
}
.title-block > div:first-child { border-left: none; }
.title-block .tb-label {
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.03em;
  margin-bottom: 0.5em;
}
.title-block .tb-brand { display: flex; align-items: center; gap: 0.7em; margin-bottom: 0.6em; }
.title-block .tb-brand img { height: 24px; }
.title-block address { font-style: normal; font-size: 0.92rem; color: var(--grey-dark); line-height: 1.6; }
.title-block .tb-meta { font-size: 0.85rem; color: var(--grey-dark); line-height: 1.9; }
.title-block .tb-nav { display: flex; flex-direction: column; gap: 0.5em; }
.title-block .tb-nav a { font-size: 0.92rem; color: var(--grey-dark); }
.title-block .tb-nav a:hover { color: var(--blue); }

@media (max-width: 760px) {
  .title-block { grid-template-columns: 1fr; }
  .title-block > div { border-left: none; border-top: 1px solid var(--rule); }
  .title-block > div:first-child { border-top: none; }
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 28px;
  font-size: 0.8rem;
  color: var(--grey-light);
}

/* ---------- page hero (interior pages) ---------- */
.page-hero {
  background: var(--off-white);
  border-bottom: 1px solid var(--rule);
  padding-top: clamp(44px, 7vw, 72px);
  padding-bottom: clamp(36px, 6vw, 56px);
}
.page-hero p.lede { font-size: 1.05rem; max-width: 58ch; color: var(--grey-dark); }
.page-hero .doc-ref {
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.03em;
  margin-bottom: 0.8em;
  display: block;
}

/* ---------- responsive nav ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    top: 84px; left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }
  .nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav a { width: 100%; padding: 0.7em 0; border-top: 1px solid var(--rule); }
  .nav a:first-child { border-top: none; }
  .nav .btn { margin: 14px 0 0; }
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 340px; }
}
