/*
Theme Name: Controlled Electrical
Theme URI: https://controlled.co.nz
Author: Controlled Electrical Ltd
Description: A bespoke responsive theme for Controlled Electrical Ltd.
Version: 1.0.0
Text Domain: controlled-electrical
*/

:root {
  --orange: #e85a00;
  --orange-dark: #c94d00;
  --ink: #1c1c1e;
  --muted: #67676d;
  --line: #dedee2;
  --mist: #f4f4f6;
  --white: #fff;
  --wrap: 1200px;
  --radius: 10px;
  --shadow: 0 24px 60px rgba(19, 19, 21, .11);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
section { scroll-margin-top: 86px; }
body { margin: 0; color: var(--ink); background: var(--white); font-family: Inter, "Helvetica Neue", Arial, sans-serif; line-height: 1.6; -webkit-font-smoothing: antialiased; }
body.menu-open { overflow: hidden; }
img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }
.container { width: min(calc(100% - 48px), var(--wrap)); margin-inline: auto; }
.section { padding: clamp(88px, 10vw, 150px) 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--orange); font-size: .77rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { width: 30px; height: 2px; background: currentColor; content: ""; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.06; letter-spacing: -.035em; }
h2 { margin-bottom: 24px; font-size: clamp(2.25rem, 4.2vw, 4.1rem); }
h3 { font-size: clamp(1.35rem, 2vw, 1.7rem); }
.lead { color: var(--muted); font-size: clamp(1rem, 1.35vw, 1.14rem); }
.btn { display: inline-flex; min-height: 52px; align-items: center; justify-content: center; gap: 12px; padding: 0 24px; border: 1px solid transparent; border-radius: 6px; font-size: .82rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; transition: transform .2s ease, background .2s ease, color .2s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: #fff; background: var(--orange); }
.btn-primary:hover { background: var(--orange-dark); }
.btn-outline { color: #fff; border-color: rgba(255,255,255,.72); background: rgba(0,0,0,.12); }
.btn-outline:hover { color: var(--ink); background: #fff; }

.site-header { position: sticky; top: 0; z-index: 100; height: 86px; border-bottom: 1px solid rgba(255,255,255,.1); background: rgba(5,5,5,.97); box-shadow: 0 8px 30px rgba(0,0,0,.14); backdrop-filter: blur(12px); }
.header-inner { display: flex; height: 100%; align-items: center; justify-content: space-between; gap: 32px; }
.brand { flex: 0 0 auto; padding: 0; border-radius: 0; background: #050505; }
.brand img { width: 214px; height: auto; object-fit: contain; }
.primary-nav { display: flex; align-items: center; gap: clamp(20px, 2vw, 34px); }
.primary-nav a { position: relative; color: #fff; font-size: .74rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.nav-item { position: relative; }
.services-trigger { display: flex; align-items: center; gap: 7px; padding: 32px 0; border: 0; color: #fff; background: transparent; font: inherit; font-size: .74rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; cursor: pointer; }
.services-trigger span { color: var(--orange); font-size: .95rem; transition: transform .2s ease; }
.services-menu:hover .services-trigger span, .services-menu.is-open .services-trigger span { transform: rotate(180deg); }
.mega-menu { position: absolute; top: calc(100% + 1px); left: 50%; display: grid; width: min(920px, calc(100vw - 48px)); grid-template-columns: 1.1fr 1fr 1fr 1fr; gap: 1px; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 0 0 12px 12px; background: #111113; box-shadow: 0 28px 70px rgba(0,0,0,.36); opacity: 0; pointer-events: none; transform: translate(-45%, 12px); transition: opacity .2s ease, transform .2s ease; }
.services-menu:hover .mega-menu, .services-menu:focus-within .mega-menu, .services-menu.is-open .mega-menu { opacity: 1; pointer-events: auto; transform: translate(-45%, 0); }
.mega-intro { padding: 24px; border-radius: 8px; background: linear-gradient(145deg, #222226, #18181b); }
.mega-intro strong { display: block; margin: 9px 0 12px; color: #fff; font-size: 1.16rem; line-height: 1.22; }
.mega-intro p { margin-bottom: 18px; color: #aaaab0; font-size: .82rem; line-height: 1.55; }
.mega-intro a { color: var(--orange); font-size: .72rem; }
.mega-kicker { color: var(--orange); font-size: .65rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.mega-card { display: flex; min-width: 0; flex-direction: column; justify-content: space-between; gap: 25px; padding: 23px 19px; border-radius: 8px; color: #fff; background: #1b1b1e; transition: background .2s ease, transform .2s ease; }
.mega-card::after { display: none; }
.mega-card:hover { background: #252529; transform: translateY(-3px); }
.mega-card > span:nth-child(2) { display: grid; gap: 8px; }
.mega-card strong { font-size: .89rem; line-height: 1.25; }
.mega-card small { color: #99999f; font-size: .71rem; font-weight: 500; line-height: 1.45; text-transform: none; }
.mega-number, .mega-card b { color: var(--orange); }
.mega-number { font-size: .68rem; letter-spacing: .1em; }
.mega-card b { align-self: flex-end; font-size: 1.2rem; }
.primary-nav a:not(.nav-quote)::after { position: absolute; right: 0; bottom: -11px; left: 0; height: 2px; background: var(--orange); content: ""; transform: scaleX(0); transition: transform .2s ease; }
.primary-nav a:hover::after { transform: scaleX(1); }
.nav-quote { padding: 13px 19px; border-radius: 6px; color: #fff; background: var(--orange); }
.menu-toggle { display: none; width: 48px; height: 48px; padding: 12px; border: 0; background: transparent; cursor: pointer; }
.menu-toggle span { display: block; height: 2px; margin: 6px 0; background: #fff; }

.hero { position: relative; display: grid; min-height: calc(100svh - 86px); align-items: center; overflow: hidden; color: #fff; background: #111; }
.hero-bg, .hero-shade { position: absolute; inset: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 61% 50%; }
.hero-shade { background: linear-gradient(90deg, rgba(5,5,6,.94) 0%, rgba(5,5,6,.74) 34%, rgba(5,5,6,.25) 63%, rgba(5,5,6,.06) 100%); }
.hero-content { position: relative; z-index: 1; width: min(690px, 56%); padding: 84px 0 90px; }
.hero-kicker { margin-bottom: 18px; color: var(--orange); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero h1 { max-width: 680px; margin-bottom: 22px; font-size: clamp(2.7rem, 5.1vw, 5rem); }
.hero-tagline { margin-bottom: 18px; color: var(--orange); font-size: clamp(1rem, 1.5vw, 1.25rem); font-weight: 900; letter-spacing: .04em; }
.hero-copy { max-width: 570px; margin-bottom: 34px; color: rgba(255,255,255,.86); font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }

.about-grid { display: grid; min-height: 630px; grid-template-columns: .82fr 1.18fr; align-items: center; gap: clamp(52px, 8vw, 110px); }
.about-copy { max-width: 485px; }
.about-copy h2 span { color: var(--orange); }
.values { display: grid; grid-template-columns: 1fr 1fr; gap: 25px 18px; margin-top: 39px; }
.value { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px; font-size: .92rem; font-weight: 750; line-height: 1.25; }
.value-icon { display: grid; width: 42px; height: 42px; place-items: center; border: 1.5px solid var(--orange); border-radius: 50%; color: var(--orange); font-size: 1.08rem; font-weight: 900; }
.about-image { position: relative; height: min(68vw, 650px); max-height: 650px; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); }
.about-image img { height: 100%; object-fit: cover; object-position: 55% center; }
.about-image::after { position: absolute; right: -1px; bottom: -1px; width: 28%; height: 8px; background: var(--orange); content: ""; }

.services { background: var(--mist); }
.section-heading { max-width: 760px; margin: 0 auto 58px; text-align: center; }
.section-heading .eyebrow { justify-content: center; }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.service-card { display: flex; min-height: 555px; flex-direction: column; overflow: hidden; border-radius: var(--radius); background: #fff; box-shadow: 0 14px 35px rgba(20,20,24,.07); transition: transform .25s ease, box-shadow .25s ease; }
.service-card:hover { transform: translateY(-7px); box-shadow: var(--shadow); }
.service-image { position: relative; height: 300px; overflow: hidden; }
.service-image img { height: 100%; object-fit: cover; transition: transform .45s ease; }
.service-card:nth-child(1) .service-image img { object-position: center 58%; }
.service-card:nth-child(2) .service-image img { object-position: center 53%; }
.service-card:nth-child(3) .service-image img { object-position: 47% center; }
.service-card:hover img { transform: scale(1.03); }
.service-image::after { position: absolute; inset: auto 0 0; height: 35%; background: linear-gradient(transparent, rgba(0,0,0,.28)); content: ""; }
.service-content { display: flex; flex: 1; flex-direction: column; align-items: flex-start; padding: 31px 30px 34px; }
.service-content p { color: var(--muted); }
.learn { margin-top: auto; color: var(--orange); font-size: .8rem; font-weight: 900; letter-spacing: .055em; text-transform: uppercase; }
.learn span { display: inline-block; margin-left: 7px; transition: transform .2s ease; }
.learn:hover span { transform: translateX(5px); }

.work-grid { display: grid; min-height: 650px; grid-template-columns: 1.2fr .8fr; gap: clamp(48px, 7vw, 95px); }
.gallery { display: grid; height: 500px; grid-template-columns: 1.2fr .8fr; grid-template-rows: 1fr 1fr; gap: 13px; }
.gallery figure { margin: 0; overflow: hidden; border-radius: 8px; background: #ddd; }
.gallery figure:first-child { grid-row: 1 / 3; }
.gallery img { height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery figure:first-child img { object-position: center 55%; }
.gallery figure:nth-child(2) img { object-position: center 52%; }
.gallery figure:hover img { transform: scale(1.035); }
.testimonial { position: relative; align-self: center; padding: 40px 0 20px 44px; }
.testimonial::before { position: absolute; top: 0; left: 0; color: var(--orange); content: "\201C"; font-family: Georgia, serif; font-size: 6rem; line-height: 1; }
.stars { margin-bottom: 22px; color: var(--orange); font-size: 1.2rem; letter-spacing: .18em; }
.quote { color: #4f4f55; font-size: 1.06rem; line-height: 1.78; }
.quote-author { margin-top: 26px; font-weight: 900; }

.site-footer { color: rgba(255,255,255,.77); background: #18181a; }
.cta-strip { padding: 62px 0; border-bottom: 1px solid rgba(255,255,255,.09); background: radial-gradient(circle at 15% 50%, rgba(232,90,0,.13), transparent 28%); }
.cta-grid { display: grid; grid-template-columns: 1.2fr .7fr auto; align-items: center; gap: 32px; }
.cta-title small { display: block; margin-bottom: 6px; color: var(--orange); font-size: .76rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.cta-title h2 { margin: 0 0 8px; color: #fff; font-size: clamp(2rem, 3.4vw, 3.3rem); }
.cta-title p { margin: 0; }
.cta-phone { display: flex; align-items: center; gap: 16px; padding: 20px 24px; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; }
.cta-phone span { color: var(--orange); font-size: 1.8rem; }
.cta-phone strong { color: #fff; font-size: 1.25rem; }
.cta-phone small { display: block; color: rgba(255,255,255,.6); }
.quote-btn { min-height: 72px; padding-inline: 30px; font-size: .96rem; }
.footer-main { display: grid; grid-template-columns: 1fr .7fr 1fr; gap: 70px; padding: 75px 0; }
.footer-brand .brand { display: inline-block; margin-bottom: 24px; }
.footer-brand p { max-width: 350px; }
.footer-title { margin-bottom: 23px; color: #fff; font-size: .82rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.footer-title::after { display: block; width: 32px; height: 2px; margin-top: 10px; background: var(--orange); content: ""; }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 24px; }
.footer-links a:hover, .contact-list a:hover { color: var(--orange); }
.contact-list { display: grid; gap: 12px; }
.contact-item { display: grid; grid-template-columns: 24px 1fr; gap: 8px; }
.contact-item span { color: var(--orange); }
.footer-bottom { padding: 22px 0; border-top: 1px solid rgba(255,255,255,.09); font-size: .8rem; }
.footer-bottom .container { display: flex; justify-content: space-between; gap: 24px; }

.quote-modal[hidden] { display: none; }
.quote-modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px; }
.quote-backdrop { position: absolute; inset: 0; background: rgba(4,4,5,.82); backdrop-filter: blur(8px); animation: fade-in .2s ease both; }
.quote-dialog { position: relative; z-index: 1; width: min(850px, 100%); max-height: calc(100svh - 48px); overflow: auto; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 35px 100px rgba(0,0,0,.45); animation: modal-in .3s cubic-bezier(.2,.8,.2,1) both; }
.quote-close { position: absolute; top: 17px; right: 18px; z-index: 2; display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid #dddde1; border-radius: 50%; color: #59595f; background: #fff; font-size: 1.5rem; cursor: pointer; }
.quote-form-view { padding: clamp(34px, 5vw, 58px); }
.quote-heading { display: grid; grid-template-columns: 58px 1fr; gap: 22px; padding-right: 45px; }
.quote-heading .eyebrow { margin-bottom: 9px; }
.quote-heading h2, .quote-success h2 { margin-bottom: 14px; font-size: clamp(2rem, 4vw, 3.2rem); }
.quote-heading p { max-width: 610px; color: var(--muted); }
.quote-mark { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 12px; color: #fff; background: var(--orange); font-weight: 900; }
.quote-form { margin-top: 35px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 21px; }
.form-grid label { display: grid; gap: 8px; }
.form-grid label > span { font-size: .74rem; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.form-wide { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea { width: 100%; border: 1px solid #d8d8dd; border-radius: 7px; outline: none; color: var(--ink); background: #fafafa; font: inherit; transition: border .2s ease, box-shadow .2s ease; }
.form-grid input, .form-grid select { height: 52px; padding: 0 15px; }
.form-grid textarea { min-height: 120px; padding: 14px 15px; resize: vertical; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(232,90,0,.12); }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-top: 26px; }
.form-actions p { max-width: 380px; margin: 0; color: #808087; font-size: .75rem; }
.quote-success { padding: clamp(55px, 8vw, 90px); text-align: center; }
.success-icon { display: grid; width: 76px; height: 76px; margin: 0 auto 26px; place-items: center; border: 2px solid var(--orange); border-radius: 50%; color: var(--orange); font-size: 2rem; font-weight: 900; }
.quote-success .eyebrow { justify-content: center; }
.quote-success > p:not(.eyebrow) { max-width: 580px; margin-inline: auto; color: var(--muted); font-size: 1.04rem; }
.success-rule { width: 55px; height: 2px; margin: 28px auto; background: var(--orange); }
.quote-success small { display: block; color: #88888e; }
.quote-success > a { display: block; margin: 6px 0 27px; font-size: 1.28rem; font-weight: 900; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(25px) scale(.98); } }

@media (max-width: 1020px) {
  .site-header { height: 76px; }
  .menu-toggle { display: block; }
  .primary-nav { position: fixed; inset: 76px 0 0; display: none; flex-direction: column; align-items: stretch; padding: 35px 28px; border-top: 1px solid rgba(255,255,255,.1); background: #050505; }
  .menu-open .primary-nav { display: flex; }
  .primary-nav a { padding: 14px 0; font-size: 1rem; }
  .services-trigger { width: 100%; justify-content: space-between; padding: 14px 0; font-size: 1rem; }
  .mega-menu { position: static; display: none; width: 100%; grid-template-columns: 1fr; margin: 8px 0 12px; padding: 8px; opacity: 1; transform: none; }
  .services-menu:hover .mega-menu { display: none; transform: none; }
  .services-menu.is-open .mega-menu { display: grid; transform: none; }
  .mega-intro { display: none; }
  .mega-card { flex-direction: row; align-items: center; gap: 14px; padding: 17px; }
  .mega-card b { align-self: center; margin-left: auto; }
  .nav-quote { margin-top: 10px; text-align: center; }
  .hero { min-height: calc(100svh - 76px); }
  .hero-content { width: min(680px, 74%); }
  .about-grid { min-height: auto; grid-template-columns: 1fr 1fr; gap: 48px; }
  .services-grid { gap: 17px; }
  .service-card { min-height: 520px; }
  .service-image { height: 250px; }
  .service-content { padding: 27px 23px 29px; }
  .work-grid { gap: 45px; }
  .cta-grid { grid-template-columns: 1fr 1fr; }
  .quote-btn { grid-column: 2; }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 36px), var(--wrap)); }
  .section { padding: 84px 0; }
  .brand img { width: 176px; }
  .hero { min-height: 780px; align-items: end; }
  .hero-bg img { object-position: 66% center; }
  .hero-shade { background: linear-gradient(180deg, rgba(5,5,6,.18) 0%, rgba(5,5,6,.46) 34%, rgba(5,5,6,.95) 69%, #050506 100%); }
  .hero-content { width: 100%; padding: 210px 0 66px; }
  .hero h1 { font-size: clamp(2.3rem, 10.5vw, 3.4rem); }
  .hero-copy { max-width: 500px; }
  .hero-actions .btn { flex: 1 1 160px; }
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-copy { max-width: none; }
  .about-image { order: -1; height: 430px; }
  .services-grid { grid-template-columns: 1fr; gap: 28px; }
  .service-card { min-height: 0; }
  .service-image { height: 300px; }
  .work-grid { min-height: 0; grid-template-columns: 1fr; gap: 52px; }
  .gallery { height: 480px; }
  .testimonial { padding-left: 36px; }
  .cta-grid, .footer-main { grid-template-columns: 1fr; }
  .quote-btn { grid-column: auto; }
  .footer-main { gap: 48px; padding: 64px 0; }
  .footer-bottom .container { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .form-wide { grid-column: auto; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .form-actions .btn { width: 100%; }
}

@media (max-width: 480px) {
  .container { width: min(calc(100% - 28px), var(--wrap)); }
  .site-header { height: 70px; }
  .brand { padding: 0; }
  .brand img { width: 155px; }
  .primary-nav { inset-block-start: 70px; }
  .hero { min-height: 750px; }
  .hero-content { padding-bottom: 45px; }
  .hero-kicker { font-size: .8rem; }
  .hero h1 { font-size: 2.18rem; }
  .values { grid-template-columns: 1fr; }
  .about-image { height: 370px; }
  .service-image { height: 250px; }
  .gallery { height: auto; grid-template-columns: 1fr 1fr; grid-template-rows: 320px 180px; }
  .gallery figure:first-child { grid-column: 1 / 3; grid-row: 1; }
  .testimonial { padding-left: 27px; }
  .footer-links { grid-template-columns: 1fr; }
  .quote-modal { padding: 10px; }
  .quote-dialog { max-height: calc(100svh - 20px); }
  .quote-form-view { padding: 62px 22px 30px; }
  .quote-heading { grid-template-columns: 1fr; padding-right: 0; }
  .quote-mark { width: 48px; height: 48px; }
  .quote-success { padding: 70px 24px 48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
