/* =========================================================
   Robinson Electrical | style.css
   Commercial electrical work, done right and on schedule.
   ========================================================= */

:root {
  --charcoal:   #2B2B2E;
  --charcoal-2: #232326;
  --black:      #181819;
  --red:        #E23B33;
  --red-dark:   #C12E27;
  --gray:       #9A9A9A;
  --off-white:  #F4F4F4;
  --white:      #FFFFFF;
  --line:       rgba(255, 255, 255, 0.10);

  --font-head:  "Barlow Condensed", Impact, "Arial Narrow", sans-serif;
  --font-body:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --maxw: 1200px;
  --gut:  clamp(20px, 4vw, 48px);
  --r:    2px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--charcoal);
  background: var(--off-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: color .2s var(--ease); }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.005em;
  text-transform: uppercase;
}
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

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

/* ---------- Shared bits ---------- */
.eyebrow,
.section-eyebrow {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 18px;
}
.section-eyebrow--light { color: var(--red); }

.section-title {
  font-size: clamp(40px, 6vw, 60px);
  color: var(--charcoal);
}
.section-title--light { color: var(--white); }

.rule {
  width: 64px;
  height: 4px;
  background: var(--red);
  margin: 18px 0 28px;
  position: relative;
}
.rule::after {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 12px;
  height: 6px;
  background: var(--red);
  transform: skewX(-30deg);
  transform-origin: left center;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--r);
  border: 2px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease),
              border-color .2s var(--ease), transform .2s var(--ease);
  will-change: transform;
}
.btn--primary {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}
.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--red-dark);
  border-color: var(--red-dark);
  transform: translateY(-2px);
}
.btn--outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}
.btn--outline:hover,
.btn--outline:focus-visible {
  background: var(--white);
  color: var(--charcoal);
  transform: translateY(-2px);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.nav.is-scrolled {
  background: var(--black);
  border-bottom-color: var(--red);
}
.nav__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav__logo {
  display: inline-flex;
  align-items: center;
}
.nav__logo img {
  height: 56px;
  width: auto;
  transition: height .25s var(--ease);
}
.nav.is-scrolled .nav__logo img { height: 46px; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav__links a {
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  padding: 6px 0;
  white-space: nowrap;
}
@media (max-width: 960px) and (min-width: 769px) {
  .nav__links { gap: 16px; }
  .nav__links a { font-size: 13px; letter-spacing: 0.10em; }
  .nav__cta { padding: 8px 14px; font-size: 12px; }
}
.nav__links a:not(.btn):not(.nav__phone)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 2px;
  background: var(--red);
  transition: right .25s var(--ease);
}
.nav__links a:not(.btn):not(.nav__phone):hover::after,
.nav__links a:not(.btn):not(.nav__phone):focus-visible::after,
.nav__links a.is-active::after { right: 0; }
.nav__phone {
  color: var(--gray) !important;
  letter-spacing: 0.12em;
}
.nav__phone:hover,
.nav__phone:focus-visible { color: var(--red) !important; }
.nav__cta { padding: 10px 20px; font-size: 14px; }
.nav__cta::after { display: none; }

.nav__toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform .2s var(--ease), opacity .2s var(--ease);
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  background: var(--black) url('hero-bg.jpg') center / cover no-repeat;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 110px var(--gut) 70px;
  overflow: hidden;
}

.hero__content {
  position: relative;
  max-width: 1000px;
  z-index: 1;
}
.hero__headline {
  font-size: clamp(36px, 6.4vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0 0 28px;
}
.hero__headline .accent { color: var(--red); }
.hero__sub {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--white);
  max-width: 720px;
  margin: 0 auto 40px;
  line-height: 1.6;
}
.hero__ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.55);
  animation: bounce 2.4s var(--ease) infinite;
  z-index: 1;
}
.hero__scroll:hover { color: var(--red); }
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 10px); }
}

/* ---------- About ---------- */
.about {
  background: var(--off-white);
  padding: clamp(72px, 10vw, 120px) 0;
}
.about__head {
  margin: 0 auto 32px;
  max-width: 820px;
  text-align: center;
}
.about__head .rule {
  margin-left: auto;
  margin-right: auto;
}
.about__copy {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.about__copy p {
  color: #333;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.75;
}
.about__copy p + p { margin-top: 1em; }

/* ---------- Services ---------- */
.services {
  background: var(--charcoal);
  color: var(--white);
  padding: clamp(72px, 10vw, 120px) 0;
  position: relative;
}
.services::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.015) 0 2px, transparent 2px 8px);
  pointer-events: none;
}
.services__head {
  position: relative;
  margin-bottom: 56px;
}
.services > .container { position: relative; }

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (min-width: 1101px) {
  .cards .card:nth-last-child(1) { grid-column: span 2; }
}
.card {
  background: var(--charcoal-2);
  border: 1px solid var(--line);
  padding: 32px 24px;
  border-radius: var(--r);
  position: relative;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 36px;
  height: 3px;
  background: var(--red);
  transition: width .25s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(226, 59, 51, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}
.card:hover::before { width: 100%; }
.card__icon {
  color: var(--red);
  margin-bottom: 20px;
}
.card__title {
  font-size: 22px;
  margin-bottom: 12px;
  color: var(--white);
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.card__copy {
  color: #C6C6C6;
  font-size: 14.5px;
  margin: 0;
  line-height: 1.55;
}

/* ---------- Projects ---------- */
.projects {
  background: var(--off-white);
  padding: clamp(72px, 10vw, 120px) 0;
}
.projects__head { margin-bottom: 56px; }

.projects__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 20px;
}
.project {
  margin: 0;
  background: var(--white);
  border-bottom: 3px solid var(--red);
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  display: flex;
  flex-direction: column;
}
.project:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}
.project--lead {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
}
.project__media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--charcoal);
}
.project--lead .project__media { aspect-ratio: 4 / 5; }
.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 500ms var(--ease);
}
.project:hover .project__media img { transform: scale(1.04); }

.project__caption {
  padding: 18px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.project__label {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--charcoal);
}
.project__detail {
  font-size: 14.5px;
  color: #555;
  line-height: 1.5;
}

/* ---------- Service Area ---------- */
.service-area {
  background: var(--charcoal);
  color: var(--white);
  padding: clamp(72px, 10vw, 120px) 0;
  position: relative;
}
.service-area::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.015) 0 2px, transparent 2px 8px);
  pointer-events: none;
}
.service-area > .container { position: relative; }
.service-area__head {
  margin: 0 auto 48px;
  max-width: 820px;
  text-align: center;
}
.service-area__head .rule {
  margin-left: auto;
  margin-right: auto;
}
.service-area__head .section-title { color: var(--white); }
.service-area__lede {
  font-size: clamp(16px, 1.6vw, 18px);
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.65;
  margin: 24px 0 0;
}

.service-area__feature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 5vw, 64px);
  margin: 0 auto 64px;
  max-width: 880px;
}
.service-area__stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.service-area__stat-num {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(96px, 14vw, 168px);
  line-height: 0.9;
  color: var(--red);
  letter-spacing: -0.02em;
}
.service-area__stat-label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(14px, 1.4vw, 16px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1.35;
  text-align: right;
  padding-right: 6px;
  border-right: 3px solid var(--red);
  padding-right: 14px;
}
.service-area__map {
  flex: 0 1 380px;
  background: transparent;
}
.service-area__map img {
  width: 100%;
  height: auto;
  display: block;
}

.service-area__counties {
  display: grid;
  grid-template-columns: 1fr;
  max-width: 980px;
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}
.county {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: 32px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  position: relative;
  transition: background .2s var(--ease);
}
.county::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0;
  background: var(--red);
  transition: height .2s var(--ease);
}
.county:hover::before { height: 60%; }
.county__name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 22px;
  color: var(--white);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}
.county__cities {
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  margin: 0;
}
.service-area__footnote {
  margin-top: 48px;
  text-align: center;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.55);
}
.service-area__footnote a {
  color: var(--red);
  border-bottom: 1px solid var(--red);
  transition: opacity .2s var(--ease);
}
.service-area__footnote a:hover { opacity: 0.7; }
@media (max-width: 760px) {
  .service-area__feature {
    flex-direction: column;
    gap: 24px;
  }
  .service-area__stat {
    align-items: center;
    flex-direction: row;
    gap: 16px;
  }
  .service-area__stat-num { font-size: 96px; }
  .service-area__stat-label {
    text-align: left;
    border-right: 0;
    border-left: 3px solid var(--red);
    padding-right: 0;
    padding-left: 14px;
  }
  .service-area__map { flex: 1 1 auto; max-width: 360px; width: 100%; }
  .county {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 0;
  }
  .county__name { font-size: 18px; }
}

/* ---------- Contact ---------- */
.contact {
  background: var(--charcoal);
  color: var(--white);
  padding: clamp(72px, 10vw, 120px) 0;
  position: relative;
}
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.015) 0 2px, transparent 2px 8px);
  pointer-events: none;
}
.contact__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(40px, 6vw, 80px);
  max-width: 1080px;
  align-items: start;
}
.contact__lede {
  color: #C6C6C6;
  margin-bottom: 32px;
  max-width: 420px;
}
.contact__list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 32px;
}
.contact__list li {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  color: var(--white);
}
.contact__list a {
  border-bottom: 1px solid transparent;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.contact__list a:hover {
  color: var(--red);
  border-bottom-color: var(--red);
}
.contact__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--red);
  color: var(--white);
  border-radius: var(--r);
  flex-shrink: 0;
}

/* ---------- Bid form ---------- */
.bid-form {
  background: var(--off-white);
  padding: clamp(28px, 4vw, 40px);
  border-left: 4px solid var(--red);
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: var(--r);
}
.bid-form__honeypot { display: none !important; }
.bid-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.bid-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.bid-form__field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.bid-form__field label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--charcoal);
  margin-bottom: 6px;
}
.bid-form__req {
  color: var(--red);
  margin-left: 2px;
}
.bid-form input[type="text"],
.bid-form input[type="email"],
.bid-form input[type="tel"],
.bid-form textarea {
  background: var(--white);
  border: 1px solid #D8D8D8;
  border-radius: var(--r);
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--charcoal);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  width: 100%;
}
.bid-form input::placeholder,
.bid-form textarea::placeholder { color: var(--gray); }
.bid-form input:focus,
.bid-form textarea:focus {
  border-color: var(--red);
  outline: none;
  box-shadow: 0 0 0 3px rgba(226, 59, 51, 0.18);
}
.bid-form textarea {
  resize: vertical;
  min-height: 130px;
}
.bid-form__submit {
  align-self: flex-start;
  margin-top: 6px;
}
.bid-form__status {
  margin: 0;
  font-size: 14px;
  color: var(--gray);
  min-height: 1.2em;
}
.bid-form__status.is-success { color: #2E7D32; }
.bid-form__status.is-error { color: #B00020; }
.bid-form__status.is-loading { color: var(--red); }

/* ---------- Thank-you page ---------- */
body[data-page="thanks"] .nav {
  background: var(--black);
  border-bottom: 2px solid var(--red);
}
body[data-page="thanks"] .nav__logo img { height: 46px; }
@media (max-width: 768px) {
  body[data-page="thanks"] .nav__logo img { height: 40px; }
}
.thanks {
  background: var(--off-white);
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  padding: clamp(120px, 18vw, 200px) 0 clamp(80px, 10vw, 120px);
}
.thanks__inner {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.thanks__headline {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(40px, 7vw, 80px);
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--charcoal);
  margin: 18px 0 24px;
}
.thanks__headline .accent { color: var(--red); }
.thanks__sub {
  color: #444;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.65;
  margin: 0 0 36px;
}
.thanks__sub a {
  color: var(--red);
  border-bottom: 1px solid var(--red);
  transition: opacity .2s var(--ease);
}
.thanks__sub a:hover { opacity: 0.75; }

/* ---------- Footer ---------- */
.footer {
  background: var(--black);
  color: var(--white);
  border-top: 2px solid var(--red);
  padding: 24px 0;
}
.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__logo img { height: 48px; width: auto; }
.footer__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.footer__phone {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 16px;
  color: var(--white);
}
.footer__phone:hover { color: var(--red); }
.footer__copy {
  margin: 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal--d1 { transition-delay: 120ms; }
.reveal--d2 { transition-delay: 240ms; }
.reveal--d3 { transition-delay: 360ms; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .reveal--d1, .reveal--d2, .reveal--d3 { transition-delay: 0ms; }
  .hero__scroll { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .projects__grid { grid-template-columns: 1fr 1fr; }
  .project--lead { grid-column: 1 / -1; grid-row: auto; }
  .project--lead .project__media { aspect-ratio: 16 / 10; }
}
@media (max-width: 768px) {
  .nav__phone { display: none; }
  .nav__links {
    position: fixed;
    top: 64px;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--black);
    border-top: 2px solid var(--red);
    padding: 12px var(--gut) 20px;
    transform: translateY(calc(-100% - 80px));
    transition: transform .3s var(--ease);
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
  }
  .nav__links.is-open { transform: translateY(0); }
  .nav__links a {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .nav__links a:last-child { border-bottom: 0; }
  .nav__phone { display: block; }
  .nav__cta { margin-top: 8px; align-self: flex-start; }
  .nav { background: var(--black); border-bottom-color: var(--red); }
  .nav__toggle { display: flex; }
  .nav__logo img { height: 44px; }

  .hero { padding-top: 120px; }

  .cards { grid-template-columns: 1fr; }

  .projects__grid { grid-template-columns: 1fr; }
  .project--lead .project__media { aspect-ratio: 4 / 3; }

  .contact__inner { grid-template-columns: 1fr; }
  .bid-form__row { grid-template-columns: 1fr; }
  .bid-form__submit { align-self: stretch; width: 100%; }

  .hero__ctas { flex-direction: column; align-items: stretch; }
  .hero__ctas .btn { width: 100%; }

  .footer__inner { flex-direction: column; text-align: center; }
  .footer__meta { align-items: center; }
}

/* Focus ring */
a:focus-visible, button:focus-visible, .btn:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}
