/* ============================================================
   SOG ELECTRICAL — Accra, Ghana
   Composition: Nord IDE palette · vertical spine headline ·
   scroll progress strip · full-bleed gallery · visualizer bars ·
   hard colour blocks per section.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Nord — polar night */
  --nord0: #2e3440;
  --nord1: #3b4252;
  --nord2: #434c5e;
  --nord3: #4c566a;
  /* Nord — snow storm */
  --nord4: #d8dee9;
  --nord5: #e5e9f0;
  --nord6: #eceff4;
  /* Nord — frost + aurora */
  --frost1: #8fbcbb;
  --frost2: #88c0d0;
  --frost3: #81a1c1;
  --frost4: #5e81ac;
  --green: #a3be8c;
  --yellow: #ebcb8b;
  --orange: #d08770;
  --red: #bf616a;

  --bg: var(--nord0);
  --ink: var(--nord6);
  --muted: var(--nord4);
  --accent: var(--frost2);
  --secondary: var(--green);
  --line: rgba(216, 222, 233, 0.16);

  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --display: "Bricolage Grotesque", "Archivo", system-ui, sans-serif;
  --body: "Archivo", system-ui, -apple-system, sans-serif;

  --spine: 4.5rem;
  --pad: clamp(1.25rem, 5vw, 5rem);
  --block: clamp(4.5rem, 11vw, 9rem);
}

/* Light mode — Nord "snow storm" inverted, same accent family */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eceff4;
    --ink: #2e3440;
    --muted: #4c566a;
    --accent: #3d7f92;
    --secondary: #4f7a3a;
    --line: rgba(46, 52, 64, 0.16);
  }
}
:root[data-theme="light"] {
  --bg: #eceff4;
  --ink: #2e3440;
  --muted: #4c566a;
  --accent: #3d7f92;
  --secondary: #4f7a3a;
  --line: rgba(46, 52, 64, 0.16);
}
:root[data-theme="dark"] {
  --bg: var(--nord0);
  --ink: var(--nord6);
  --muted: var(--nord4);
  --accent: var(--frost2);
  --secondary: var(--green);
  --line: rgba(216, 222, 233, 0.16);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--secondary); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
p { margin: 0 0 1.1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ---------- Utility ---------- */
.wrap { max-width: 62rem; margin-inline: auto; padding-inline: var(--pad); }
.mono { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.lede { font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem); color: var(--muted); max-width: 46ch; }

/* ============================================================
   HEADER — thin IDE-style chrome bar
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  padding: 0.6rem var(--pad);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink); text-decoration: none;
  display: flex; align-items: center; gap: 0.55rem; white-space: nowrap;
}
.brand .dot { width: 8px; height: 8px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 10px var(--accent); }
.topnav { margin-left: auto; display: flex; gap: 1.1rem; align-items: center; }
.topnav a {
  font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink); text-decoration: none;
  padding: 0.5rem 0.15rem;
}
.topnav a:hover { color: var(--accent); }
.theme-btn {
  width: 44px; height: 44px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); border-radius: 4px;
  color: var(--muted); cursor: pointer;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn svg { width: 17px; height: 17px; }
:root[data-theme="dark"] .icon-sun,
:root:not([data-theme]) .icon-sun { display: none; }
:root[data-theme="light"] .icon-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-sun { display: none; }
  :root:not([data-theme="dark"]) .icon-moon { display: block; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}
@media (max-width: 640px) {
  .topnav a { display: none; }
  .topnav a.keep { display: block; }
}

/* ---------- Scroll progress strip (design element, not chrome) ---------- */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60;
  background: transparent; pointer-events: none;
}
.progress span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--frost4), var(--accent), var(--secondary));
  transform-origin: 0 50%; transform: scaleX(0);
}
@supports (animation-timeline: scroll()) {
  .progress span { animation: fill linear both; animation-timeline: scroll(root block); }
}
@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ============================================================
   VERTICAL SPINE HEADLINE
   ============================================================ */
.spine {
  position: fixed; left: 0.35rem; top: 50%; transform: translateY(-50%);
  z-index: 30; writing-mode: vertical-rl; text-orientation: mixed;
  font-family: var(--display); font-weight: 800;
  font-size: clamp(1.5rem, 1rem + 2.4vw, 3.1rem);
  letter-spacing: 0.02em; line-height: 1;
  color: var(--ink); mix-blend-mode: difference;
  pointer-events: none; user-select: none;
  padding-block: 0.5rem;
}
.spine em { font-style: normal; color: var(--accent); mix-blend-mode: normal; }
@media (max-width: 900px) {
  .spine {
    position: static; writing-mode: horizontal-tb; transform: none;
    mix-blend-mode: normal; padding: 1.6rem var(--pad) 0;
    font-size: clamp(2rem, 9vw, 3rem);
  }
  .spine em { color: var(--accent); }
}

/* ============================================================
   HERO — full-bleed image + visualizer bars
   ============================================================ */
.hero { position: relative; isolation: isolate; }
.hero-media { position: relative; height: clamp(60vh, 78vh, 46rem); overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85) contrast(1.05); }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,24,31,0.72) 0%, rgba(20,24,31,0.55) 40%, rgba(20,24,31,0.96) 100%);
}
.hero-copy {
  position: absolute; inset: auto 0 0 0; z-index: 2;
  padding: 0 var(--pad) clamp(1.5rem, 4vw, 3rem);
  padding-left: calc(var(--pad) + var(--spine));
  color: var(--nord6);
}
.hero-copy .mono { color: #a8d8e6; display: block; margin-bottom: 0.9rem; }
.hero-copy h2 {
  font-size: clamp(2.1rem, 1.2rem + 5.4vw, 5.2rem);
  font-weight: 800; max-width: 20ch; text-wrap: balance;
}
.hero-copy h2 span { color: #a8d8e6; }
.hero-copy p { margin-top: 1rem; max-width: 44ch; color: #dfe5ee; }

/* Visualizer bars */
.viz {
  display: flex; align-items: flex-end; gap: 3px; height: 46px;
  margin: 1.4rem 0 0; max-width: 22rem;
}
.viz i {
  flex: 1; background: var(--frost2); border-radius: 1px;
  height: 30%; transform-origin: 50% 100%;
  animation: pulse 1.5s ease-in-out infinite alternate;
  opacity: 0.9;
}
.viz i:nth-child(3n) { background: var(--green); }
.viz i:nth-child(4n) { background: var(--frost4); }
.viz i:nth-child(1) { animation-delay: -0.1s; }
.viz i:nth-child(2) { animation-delay: -0.5s; }
.viz i:nth-child(3) { animation-delay: -0.9s; }
.viz i:nth-child(4) { animation-delay: -0.3s; }
.viz i:nth-child(5) { animation-delay: -1.2s; }
.viz i:nth-child(6) { animation-delay: -0.7s; }
.viz i:nth-child(7) { animation-delay: -1.4s; }
.viz i:nth-child(8) { animation-delay: -0.2s; }
.viz i:nth-child(9) { animation-delay: -1.1s; }
.viz i:nth-child(10) { animation-delay: -0.6s; }
.viz i:nth-child(11) { animation-delay: -1.3s; }
.viz i:nth-child(12) { animation-delay: -0.4s; }
.viz i:nth-child(13) { animation-delay: -0.8s; }
.viz i:nth-child(14) { animation-delay: -1.5s; }
.viz i:nth-child(15) { animation-delay: -0.25s; }
.viz i:nth-child(16) { animation-delay: -1.05s; }
.viz i:nth-child(17) { animation-delay: -0.55s; }
.viz i:nth-child(18) { animation-delay: -1.35s; }
.viz i:nth-child(19) { animation-delay: -0.15s; }
.viz i:nth-child(20) { animation-delay: -0.95s; }
.viz i:nth-child(21) { animation-delay: -0.45s; }
.viz i:nth-child(22) { animation-delay: -1.25s; }
.viz i:nth-child(23) { animation-delay: -0.65s; }
.viz i:nth-child(24) { animation-delay: -1.45s; }
@keyframes pulse {
  from { transform: scaleY(0.18); }
  to   { transform: scaleY(1); }
}

/* ---------- Quick facts strip ---------- */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1px; background: var(--line); border-block: 1px solid var(--line);
}
.facts div { background: var(--bg); padding: 1.4rem var(--pad); }
.facts dt { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.4rem; }

.facts dd { margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.15rem; }

/* ============================================================
   SECTION BLOCKS — hard colour per section
   ============================================================ */
.block { padding: var(--block) 0; }
.block--nord1 { background: var(--nord1); color: var(--nord6); }
.block--nord2 { background: var(--nord2); color: var(--nord6); }
.block--frost { background: #3c5a7d; color: #f2f6fb; }
.block--green { background: var(--green); color: #1f2a17; }
.block--yellow { background: var(--yellow); color: #33290f; }
.block--plain { background: var(--bg); color: var(--ink); }

.block--nord1 .lede, .block--nord2 .lede, .block--frost .lede { color: rgba(236, 239, 244, 0.92); }
.block--green .lede, .block--yellow .lede { color: rgba(31, 42, 23, 0.78); }
.block--green .lede { color: rgba(31, 42, 23, 0.8); }
.block--yellow .lede { color: rgba(51, 41, 15, 0.8); }
.block--nord1 a, .block--nord2 a, .block--frost a { color: #a8d8e6; }
.block--green a { color: #1f3d12; }
.block--yellow a { color: #4a3410; }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem 1.5rem; margin-bottom: 2.5rem; }
.section-head h2 { font-size: clamp(1.7rem, 1.2rem + 2.6vw, 3.1rem); }
.section-head .mono { color: currentColor; opacity: 0.82; }

/* ---------- Services grid ---------- */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1px; background: rgba(236,239,244,0.18); border: 1px solid rgba(236,239,244,0.18); }
.service { background: var(--nord2); padding: 1.75rem 1.6rem 1.9rem; }
.service .num { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; color: #a8d8e6; display: block; margin-bottom: 0.9rem; }
.service h3 { font-size: 1.22rem; margin-bottom: 0.6rem; }
.service p { font-size: 0.95rem; color: rgba(236,239,244,0.88); margin: 0; }
.service ul { margin: 0.9rem 0 0; padding: 0; list-style: none; font-size: 0.86rem; color: rgba(236,239,244,0.8); }
.service li { padding-left: 1rem; position: relative; }
.service li::before { content: "—"; position: absolute; left: 0; color: var(--green); }

/* ---------- Full-bleed gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0; }
.gallery figure { margin: 0; position: relative; grid-column: 1 / -1; }
.gallery figure.half { grid-column: span 6; }
.gallery figure img { width: 100%; height: clamp(16rem, 42vw, 34rem); object-fit: cover; }
.gallery figure.half img { height: clamp(14rem, 30vw, 26rem); }
.gallery figcaption {
  position: absolute; left: 0; bottom: 0; right: 0;
  padding: 2.5rem var(--pad) 1.4rem;
  background: linear-gradient(180deg, transparent, rgba(46,52,64,0.88));
  color: var(--nord6);
  display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: baseline;
}
.gallery figcaption strong { font-family: var(--display); font-size: 1.05rem; }
.gallery figcaption span { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: #a8d8e6; }
@media (max-width: 720px) {
  .gallery figure.half { grid-column: 1 / -1; }
}

/* ---------- Process list ---------- */
.process { counter-reset: step; display: grid; gap: 0; }
.step { display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.25rem; padding: 1.6rem 0; border-top: 1px solid rgba(31,42,23,0.22); }
.step:last-child { border-bottom: 1px solid rgba(31,42,23,0.22); }
.step .n { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.1em; padding-top: 0.35rem; color: #2f4a1f; }
.step h3 { font-size: 1.2rem; margin-bottom: 0.45rem; }
.step p { margin: 0; font-size: 0.96rem; }

/* ---------- Coverage / areas ---------- */
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.5rem 2rem; }
.area h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.area p { margin: 0; font-size: 0.9rem; color: rgba(236,239,244,0.86); }
.block--plain .area p { color: var(--muted); }

/* ---------- Rates table ---------- */
.rates { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.rates caption { text-align: left; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: #4a3410; padding-bottom: 1rem; }
.rates th, .rates td { text-align: left; padding: 0.85rem 0.75rem; border-bottom: 1px solid rgba(51,41,15,0.22); vertical-align: top; }
.rates th { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; color: #4a3410; }
.rates td:last-child { text-align: right; white-space: nowrap; font-family: var(--mono); font-size: 0.86rem; }
.rates tr:last-child td { border-bottom: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.4rem; }
label { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(236,239,244,0.72); }
input, select, textarea {
  width: 100%; font: inherit; font-size: 0.98rem;
  padding: 0.8rem 0.9rem; min-height: 44px;
  background: rgba(46,52,64,0.55); color: var(--nord6);
  border: 1px solid rgba(236,239,244,0.28); border-radius: 3px;
}
textarea { min-height: 8rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(236,239,244,0.42); }
input:focus, select:focus, textarea:focus { border-color: var(--frost2); outline: 2px solid var(--frost2); outline-offset: 1px; }
select option { background: var(--nord1); color: var(--nord6); }
button[type="submit"] {
  justify-self: start; min-height: 48px; padding: 0.85rem 1.9rem;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--frost2); color: #1b2b33; border: 0; border-radius: 3px; cursor: pointer;
}
button[type="submit"]:hover { background: var(--green); }
button[type="submit"]:disabled { opacity: 0.6; cursor: progress; }
.form-status { margin: 0; font-size: 0.9rem; color: var(--green); min-height: 1.4em; }
.form-status[data-state="error"] { color: var(--red); }

.contact-list { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 1.15rem; }
.contact-list dt { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: #b6dfec; margin-bottom: 0.25rem; }
.contact-list dd { margin: 0; font-size: 1rem; }
.contact-list a { color: var(--nord6); }
.contact-list a:hover { color: var(--frost2); }

/* ---------- Footer ---------- */
.site-foot { background: var(--nord0); color: var(--nord4); padding: 3.5rem 0 5rem; border-top: 1px solid var(--line); }
.foot-grid { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; justify-content: space-between; align-items: flex-end; }
.site-foot .mono { color: #b3bdcf; }
.site-foot a { color: var(--nord4); }

/* Attribution — required on free tier, kept legible */
.attribution {
  position: static; opacity: 1; font-size: 0.72rem;
  font-family: var(--mono); letter-spacing: 0.08em;
  margin-top: 2.5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--line); color: var(--nord4);
}
.attribution a { color: var(--frost2); }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .viz i { animation: none; transform: scaleY(0.55); }
  .progress span { animation: none; transform: scaleX(1); opacity: 0.5; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
