/* ============================================================
   Universal Electrics Ltd — redesigned site
   Plain static HTML/CSS/JS. No build step.
   Deploy: drag the folder onto Cloudflare Pages, or port the
   semantic sections into a WordPress theme later.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --cream: #f5f1e8;
  --cream-2: #ede7d9;
  --ink: #1b1813;
  --ink-soft: #57503f;
  --ink-faint: #8a8171;
  --accent: #e89b1c;
  --accent-deep: #c9820a;
  --dark: #17130d;
  --dark-2: #221c13;
  --line: rgba(27, 24, 19, 0.14);
  --line-light: rgba(245, 241, 232, 0.16);
  --max: 1200px;
  --pad: clamp(20px, 4vw, 56px);
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
::selection { background: var(--accent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; border-radius: 2px; }

/* ---------- Type helpers ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 0.98;
}
.label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.label::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent);
  flex: none;
}
.label--light { color: rgba(245, 241, 232, 0.6); }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.section { padding-top: clamp(72px, 10vw, 140px); padding-bottom: clamp(72px, 10vw, 140px); }
.section--tight { padding-top: clamp(48px, 7vw, 96px); padding-bottom: clamp(48px, 7vw, 96px); }
.section--dark { background: var(--dark); color: var(--cream); }
.section--cream2 { background: var(--cream-2); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(245, 241, 232, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 84px;
  transition: height 0.35s var(--ease);
}
.site-header.is-scrolled .header-inner { height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.brand-tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.main-nav { display: flex; align-items: center; gap: 34px; }
.nav-link {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 0;
  color: var(--ink-soft);
  transition: color 0.25s;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.nav-link:hover, .nav-link.is-active { color: var(--ink); }
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); transform-origin: left; }
.header-cta { display: flex; align-items: center; gap: 14px; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px; height: 44px;
  align-items: center;
}
.nav-toggle span {
  display: block;
  width: 26px; height: 2px;
  background: var(--ink);
  transition: transform 0.35s var(--ease), opacity 0.25s;
}
body.menu-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--dark);
  color: var(--cream);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 var(--pad);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.55s var(--ease), visibility 0s 0.55s;
}
body.menu-open .mobile-menu { clip-path: inset(0 0 0% 0); visibility: visible; transition: clip-path 0.55s var(--ease); }
.mobile-menu a.mm-link {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(38px, 9vw, 64px);
  letter-spacing: -0.03em;
  line-height: 1.15;
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-light);
  transform: translateY(30px);
  opacity: 0;
  transition: transform 0.6s var(--ease), opacity 0.6s;
}
body.menu-open .mobile-menu a.mm-link { transform: translateY(0); opacity: 1; }
body.menu-open .mobile-menu a.mm-link:nth-child(2) { transition-delay: 0.08s; }
body.menu-open .mobile-menu a.mm-link:nth-child(3) { transition-delay: 0.14s; }
body.menu-open .mobile-menu a.mm-link:nth-child(4) { transition-delay: 0.2s; }
.mm-link .mm-num { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: 0.1em; }
.mobile-menu .mm-foot { margin-top: 40px; font-size: 15px; color: rgba(245, 241, 232, 0.65); display: flex; flex-direction: column; gap: 6px; }

/* ---------- Buttons (text-flip hover) ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  overflow: hidden;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn .btn-flip { position: relative; display: inline-block; overflow: hidden; height: 1.35em; }
.btn .btn-flip span { display: block; transition: transform 0.4s var(--ease); }
.btn:hover .btn-flip span { transform: translateY(-100%); }
.btn .btn-arrow { transition: transform 0.35s var(--ease); }
.btn:hover .btn-arrow { transform: translate(3px, -3px); }
.btn--accent { background: var(--accent); color: var(--ink); }
.btn--accent:hover { background: var(--accent-deep); color: var(--ink); }
.btn--ghost { border: 1.5px solid var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--ghost-light { border: 1.5px solid var(--line-light); color: var(--cream); }
.btn--ghost-light:hover { border-color: var(--cream); }
.btn--sm { padding: 11px 20px; font-size: 13.5px; }

/* Text link with underline grow */
.tlink {
  position: relative;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 3px;
}
.tlink::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.tlink:hover::after { transform: scaleX(1); transform-origin: left; }
.tlink svg { transition: transform 0.3s var(--ease); }
.tlink:hover svg { transform: translateX(4px); }

/* ---------- Hero ---------- */
.hero { padding-top: calc(84px + clamp(48px, 8vw, 110px)); }
.hero-grid { display: grid; gap: clamp(32px, 5vw, 64px); }
.hero-title {
  font-size: clamp(44px, 8.2vw, 108px);
  max-width: 13ch;
}
.hero-title .hl {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.hero-title .hl svg {
  position: absolute;
  left: -4%; bottom: 0.02em;
  width: 108%; height: 0.32em;
  z-index: -1;
}
.hero-title .hl svg path { fill: var(--accent); opacity: 0.9; }
.hero-sub {
  max-width: 46ch;
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--ink-soft);
  margin-top: 26px;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 36px; }
.hero-figure { position: relative; margin-top: clamp(8px, 2vw, 24px); }
.hero-figure img {
  width: 100%;
  aspect-ratio: 21 / 9;
  object-fit: cover;
  border-radius: 22px;
}
.hero-badge {
  position: absolute;
  left: clamp(14px, 3vw, 36px);
  bottom: clamp(14px, 3vw, 36px);
  background: rgba(23, 19, 13, 0.82);
  backdrop-filter: blur(10px);
  color: var(--cream);
  border-radius: 14px;
  padding: 16px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.hero-badge .hb-num { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -0.02em; color: var(--accent); }
.hero-badge .hb-txt { font-size: 12.5px; line-height: 1.4; color: rgba(245, 241, 232, 0.85); max-width: 22ch; }

/* Word reveal animation */
.reveal-words .w { display: inline-block; overflow: hidden; vertical-align: bottom; }
.reveal-words .w > span { display: inline-block; transform: translateY(110%); transition: transform 0.8s var(--ease); }
.reveal-words.in-view .w > span { transform: translateY(0); }

/* ---------- Marquee ---------- */
.marquee {
  background: var(--accent);
  color: var(--ink);
  overflow: hidden;
  padding: 14px 0;
  transform: rotate(-1.1deg) scale(1.02);
  margin: clamp(48px, 7vw, 96px) 0;
}
.marquee-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: marquee 28s linear infinite;
}
.marquee-track span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 26px;
  display: inline-flex;
  align-items: center;
  gap: 26px;
  white-space: nowrap;
}
.marquee-track span::after { content: "⚡"; font-size: 15px; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Section headers ---------- */
.sec-head { display: flex; flex-direction: column; gap: 18px; margin-bottom: clamp(36px, 5vw, 64px); }
.sec-title { font-size: clamp(34px, 5vw, 64px); max-width: 18ch; }
.sec-lead { max-width: 52ch; color: var(--ink-soft); font-size: 17px; }

/* ---------- Editorial split (label left / content right) ---------- */
.split { display: grid; grid-template-columns: minmax(220px, 1fr) 2.2fr; gap: clamp(28px, 5vw, 72px); align-items: start; }

/* ---------- Service rows ---------- */
.svc-list { border-top: 1px solid var(--line); }
.svc-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 22px 12px;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background 0.35s var(--ease), color 0.35s, padding 0.35s var(--ease);
}
.svc-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.35s var(--ease);
  z-index: 0;
}
.svc-row > * { position: relative; z-index: 1; }
.svc-row:hover::before, .svc-row:focus-visible::before { transform: scaleY(1); transform-origin: top; }
.svc-row:hover, .svc-row:focus-visible { color: var(--cream); padding-left: 24px; }
.svc-num { font-size: 13px; font-weight: 600; letter-spacing: 0.12em; color: var(--ink-faint); transition: color 0.3s; }
.svc-row:hover .svc-num, .svc-row:focus-visible .svc-num { color: var(--accent); }
.svc-name { font-family: var(--font-display); font-weight: 750; font-size: clamp(20px, 2.6vw, 30px); letter-spacing: -0.02em; }
.svc-arrow { opacity: 0; transform: translateX(-8px); transition: opacity 0.3s, transform 0.35s var(--ease); }
.svc-row:hover .svc-arrow, .svc-row:focus-visible .svc-arrow { opacity: 1; transform: translateX(0); }

/* ---------- Why us ---------- */
.why-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.why-cell { background: var(--cream); padding: clamp(28px, 4vw, 48px); transition: background 0.35s; }
.why-cell:hover { background: var(--cream-2); }
.why-num { font-family: var(--font-display); font-weight: 800; font-size: clamp(40px, 5vw, 60px); color: var(--accent); letter-spacing: -0.03em; line-height: 1; }
.why-title { font-family: var(--font-display); font-weight: 750; font-size: 21px; letter-spacing: -0.01em; margin: 18px 0 10px; }
.why-txt { color: var(--ink-soft); font-size: 15px; max-width: 38ch; }

/* ---------- Gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(14px, 2vw, 24px); }
.g-item { position: relative; overflow: hidden; border-radius: 16px; grid-column: span 6; }
.g-item:nth-child(3n + 1) { grid-column: span 7; }
.g-item:nth-child(3n + 2) { grid-column: span 5; }
.g-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.7s var(--ease); }
.g-item:hover img { transform: scale(1.05); }
.g-cap {
  position: absolute;
  left: 14px; bottom: 14px;
  background: rgba(23, 19, 13, 0.8);
  backdrop-filter: blur(8px);
  color: var(--cream);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 0.35s, transform 0.4s var(--ease);
}
.g-item:hover .g-cap { opacity: 1; transform: translateY(0); }

/* ---------- Process strip ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 56px); counter-reset: step; }
.step { border-top: 2px solid var(--line-light); padding-top: 22px; }
.step .step-num { font-size: 12px; font-weight: 700; letter-spacing: 0.2em; color: var(--accent); }
.step h3 { font-family: var(--font-display); font-weight: 750; font-size: 22px; margin: 12px 0 8px; letter-spacing: -0.01em; }
.step p { font-size: 15px; color: rgba(245, 241, 232, 0.65); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.c-block { border-top: 1px solid var(--line); padding: 22px 0; display: flex; flex-direction: column; gap: 4px; }
.c-block .c-label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-faint); }
.c-block a.c-value { font-family: var(--font-display); font-weight: 750; font-size: clamp(20px, 2.4vw, 28px); letter-spacing: -0.02em; transition: color 0.25s; }
.c-block a.c-value:hover { color: var(--accent-deep); }
.c-block .c-value--plain { font-size: 17px; color: var(--ink-soft); }

/* Form */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: clamp(24px, 3.5vw, 44px); box-shadow: 0 24px 60px -30px rgba(27, 24, 19, 0.25); }
.form-title { font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -0.02em; }
.form-sub { color: var(--ink-soft); font-size: 14.5px; margin: 8px 0 26px; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.f-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.f-field label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-soft); }
.f-field input, .f-field select, .f-field textarea {
  font: inherit;
  font-size: 15px;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  transition: border-color 0.25s, box-shadow 0.25s;
  width: 100%;
}
.f-field textarea { min-height: 120px; resize: vertical; }
.f-field input:focus, .f-field select:focus, .f-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 155, 28, 0.22);
}
.f-field.is-error input, .f-field.is-error select, .f-field.is-error textarea { border-color: #c0452f; }
.f-error { font-size: 12.5px; color: #c0452f; display: none; }
.f-field.is-error .f-error { display: block; }
.form-status { display: none; margin-top: 18px; padding: 14px 18px; border-radius: 12px; font-size: 14.5px; font-weight: 500; }
.form-status.is-ok { display: block; background: #e5f3e8; color: #1f6b35; border: 1px solid #b9dcc2; }
.form-status.is-bad { display: block; background: #f9e9e5; color: #9c3018; border: 1px solid #ecc9bf; }
.form-note { font-size: 12.5px; color: var(--ink-faint); margin-top: 14px; }

/* Map */
.map-frame { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
.map-frame iframe { display: block; width: 100%; height: 380px; border: 0; filter: grayscale(0.25) sepia(0.12); }

/* ---------- CTA band ---------- */
.cta-band { text-align: center; }
.cta-title { font-size: clamp(36px, 6.5vw, 84px); max-width: 16ch; margin: 18px auto 0; }
.cta-title a { color: var(--accent); transition: color 0.3s; }
.cta-title a:hover { color: var(--cream); }
.cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 22px; margin-top: 40px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: var(--cream); padding: clamp(56px, 8vw, 96px) 0 32px; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: clamp(28px, 4vw, 56px); padding-bottom: clamp(36px, 5vw, 64px); border-bottom: 1px solid var(--line-light); }
.footer-brand p { color: rgba(245, 241, 232, 0.6); font-size: 14.5px; max-width: 34ch; margin-top: 16px; }
.footer-col h4 { font-size: 11.5px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(245, 241, 232, 0.45); margin-bottom: 18px; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 14.5px; color: rgba(245, 241, 232, 0.8); transition: color 0.25s; }
.footer-col a:hover { color: var(--accent); }
.footer-contact li { color: rgba(245, 241, 232, 0.8); font-size: 14.5px; margin-bottom: 12px; display: flex; gap: 10px; align-items: baseline; }
.footer-contact li strong { color: var(--cream); font-weight: 600; }
.footer-word {
  font-family: var(--font-display);
  font-weight: 850;
  font-size: clamp(52px, 11vw, 150px);
  letter-spacing: -0.04em;
  line-height: 1;
  color: rgba(245, 241, 232, 0.07);
  white-space: nowrap;
  padding: clamp(28px, 4vw, 48px) 0 0;
  text-align: center;
  user-select: none;
}
.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; padding-top: 24px; font-size: 13px; color: rgba(245, 241, 232, 0.45); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding-top: calc(84px + clamp(56px, 9vw, 120px)); padding-bottom: clamp(36px, 5vw, 64px); }
.page-hero .hero-title { font-size: clamp(40px, 7vw, 88px); }

/* ---------- Reveal on scroll ---------- */
.rv { opacity: 0; transform: translateY(34px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.rv.in-view { opacity: 1; transform: none; }
.rv-d1 { transition-delay: 0.08s; }
.rv-d2 { transition-delay: 0.16s; }
.rv-d3 { transition-delay: 0.24s; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .main-nav, .header-cta .btn { display: none; }
  .nav-toggle { display: flex; }
  .why-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .f-row { grid-template-columns: 1fr; }
  .hero-figure img { aspect-ratio: 4 / 3; }
}
@media (max-width: 640px) {
  .g-item, .g-item:nth-child(3n + 1), .g-item:nth-child(3n + 2) { grid-column: span 12; }
  .svc-row { grid-template-columns: 44px 1fr auto; gap: 12px; }
  .footer-top { grid-template-columns: 1fr; }
  .hero-badge { position: static; margin-top: 12px; width: fit-content; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .rv, .reveal-words .w > span { transition: none; opacity: 1; transform: none; }
}
