:root {
  --navy: #0a2463;
  --red: #c8102e;
  --white: #ffffff;
  --ink: #1a1a1a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

section[id] {
  scroll-margin-top: 6.5rem;
}

@media (max-width: 780px) {
  section[id] {
    scroll-margin-top: 4.75rem;
  }
}

body {
  font-family: "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background-color: var(--white);
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 2rem;
  background-color: var(--navy);
  border-bottom: 5px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  color: var(--white);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ---------- Navigation ---------- */
.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.main-nav a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus {
  background-color: var(--red);
  color: var(--white);
}

/* ---------- Hamburger toggle ---------- */
.nav-toggle {
  display: none;
  /* 44px minimum on both axes -- the accepted floor for a touch target. */
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  cursor: pointer;
}

/* Three bars drawn from one element: the box is the middle bar, the
   pseudo-elements are the outer two. */
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 24px;
  height: 3px;
  background-color: var(--white);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before { top: -8px; }
.nav-toggle-bars::after  { top: 8px; }

/* Open state: outer bars rotate into an X, middle bar fades out. */
.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background-color: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  transform: translateY(-8px) rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    transition: none;
  }
}

@media (max-width: 780px) {
  .site-header {
    flex-wrap: nowrap;
    padding: 1rem 1.25rem;
  }

  .logo {
    font-size: 1.4rem;
  }

  .nav-toggle {
    display: flex;
  }

  /* Full-width drawer below the header bar */
  .main-nav {
    flex-basis: 100%;
    order: 3;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.75rem;
  }

  .main-nav a {
    padding: 0.85rem 0.75rem;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0;
  }

  /* Collapsed only where JS can reopen it. Without JS the menu stays
     visible rather than being sealed shut by a button that does nothing. */
  .has-js-nav .main-nav {
    display: none;
  }

  .has-js-nav .main-nav.is-open {
    display: block;
  }

  /* Inline links measured 20-22px tall. Padding lifts them toward the
     44px target without changing how they look. */
  .footer-col li {
    margin-bottom: 0;
  }

  .footer-col a {
    display: inline-block;
    padding: 0.75rem 0;
  }

  .contact-link {
    display: inline-block;
    padding: 0.65rem 0;
  }

  /* The photo is heavily scrimmed at this width; ease it back so the
     roofer is actually visible behind the copy. */
  .hero {
    --hero-scrim: linear-gradient(
      180deg,
      rgba(6, 21, 57, 0.9) 0%,
      rgba(6, 21, 57, 0.78) 60%,
      rgba(6, 21, 57, 0.9) 100%
    );
  }
}

/* ---------- Sections ---------- */
.section-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.section-title {
  font-size: 2.1rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
}

.section-title::after {
  content: "";
  display: block;
  width: 70px;
  height: 4px;
  margin-top: 0.75rem;
  background-color: var(--red);
}

/* ---------- About ---------- */
.about {
  background-color: var(--white);
}

.lede {
  font-size: 1.1rem;
  line-height: 1.8;
}

/* ---------- Services ---------- */
.services {
  background-color: #f4f6fb;
  border-top: 1px solid #dde2ee;
  border-bottom: 1px solid #dde2ee;
}

.section-inner--wide {
  max-width: 1140px;
}

.section-intro {
  max-width: 640px;
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  background-color: var(--white);
  border: 1px solid #dde2ee;
  border-top: 4px solid var(--red);
  border-radius: 6px;
  padding: 1.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(10, 36, 99, 0.12);
}

.service-name {
  font-size: 1.15rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.service-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 0.9rem;
}

.service-price span {
  font-size: 0.85rem;
  font-weight: 600;
  color: #5a6480;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.service-desc {
  font-size: 0.97rem;
  line-height: 1.65;
  color: #3c4356;
}

.service-note {
  margin-top: 2rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #5a6480;
  font-style: italic;
}

/* ---------- Testimonials ---------- */
.testimonials {
  background-color: var(--navy);
  color: var(--white);
}

.section-title--light {
  color: var(--white);
}

.section-intro--light {
  color: #c7d0e8;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 760px) {
  .testimonial-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.testimonial-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 2rem 1.75rem 1.5rem;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 4px solid var(--red);
  border-radius: 6px;
}

.stars {
  color: #ffc542;
  font-size: 1.1rem;
  letter-spacing: 3px;
  margin-bottom: 1rem;
}

.testimonial-card blockquote {
  margin: 0 0 1.5rem;
  flex-grow: 1;
}

.testimonial-card blockquote p {
  font-size: 1rem;
  line-height: 1.75;
  color: #eef1f9;
}

.testimonial-card blockquote p::before {
  content: "\201C";
}

.testimonial-card blockquote p::after {
  content: "\201D";
}

.testimonial-card figcaption {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.client-name {
  display: block;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.client-meta {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #b9c4e0;
}

.star-empty {
  color: rgba(255, 255, 255, 0.28);
}

/* ---------- Contact ---------- */
.contact {
  background-color: var(--white);
}

.contact-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 860px) {
  .contact-layout {
    grid-template-columns: 320px 1fr;
    gap: 3rem;
  }
}

.contact-heading {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--navy);
  margin-bottom: 0.5rem;
}

.contact-details .contact-heading {
  margin-top: 1.5rem;
}

.contact-details .contact-heading:first-child {
  margin-top: 0;
}

.contact-details address,
.contact-details p {
  font-style: normal;
  line-height: 1.7;
  color: #3c4356;
}

.contact-link {
  color: var(--red);
  font-weight: 600;
  text-decoration: none;
}

.contact-link:hover,
.contact-link:focus {
  text-decoration: underline;
}

.emergency {
  margin-top: 1.75rem;
  padding: 0.9rem 1rem;
  background-color: #fdeaed;
  border-left: 4px solid var(--red);
  border-radius: 4px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #8e1122 !important;
}

/* ---------- Form ---------- */
.contact-form {
  background-color: #f4f6fb;
  border: 1px solid #dde2ee;
  border-top: 4px solid var(--navy);
  border-radius: 6px;
  padding: 2rem;
}

.contact-form .contact-heading {
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 560px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }
}

.field {
  margin-bottom: 1.25rem;
}

.field-row .field {
  margin-bottom: 0;
}

.field-row {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--navy);
}

.req {
  color: var(--red);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background-color: var(--white);
  border: 1px solid #c3cbdf;
  border-radius: 4px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.15);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #949db5;
}

.btn-submit {
  display: inline-block;
  width: 100%;
  padding: 0.95rem 1.5rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--white);
  background-color: var(--red);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn-submit:hover,
.btn-submit:focus {
  background-color: #a20d26;
}

.btn-submit:active {
  transform: translateY(1px);
}

.form-note {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  color: #5a6480;
}

/* ---------- Urgency radios ---------- */
.urgency {
  border: none;
  padding: 0;
}

.urgency legend {
  padding: 0;
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--navy);
}

.radio-group {
  display: grid;
  gap: 0.5rem;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  background-color: var(--white);
  border: 1px solid #c3cbdf;
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #3c4356;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.radio-option:hover,
.checkbox-option:hover {
  border-color: var(--navy);
}

.radio-option input,
.checkbox-option input {
  flex-shrink: 0;
  margin-top: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--red);
  cursor: pointer;
}

.radio-option:focus-within,
.checkbox-option:focus-within {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(10, 36, 99, 0.15);
}

.radio-option strong {
  color: var(--navy);
}

/* ---------- File upload ---------- */
.optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #5a6480;
}

.field input[type="file"] {
  padding: 0.6rem;
  /* Must stay at 16px: iOS Safari zooms the viewport on focus below that,
     and it does not zoom back out. */
  font-size: 1rem;
  cursor: pointer;
}

.field input[type="file"]::file-selector-button {
  margin-right: 0.85rem;
  padding: 0.45rem 0.9rem;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--white);
  background-color: var(--navy);
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.field input[type="file"]::file-selector-button:hover {
  background-color: #071a48;
}

.field-hint {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #5a6480;
}

/* ---------- Consent ---------- */
.consent .checkbox-option {
  align-items: flex-start;
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: clamp(520px, 76vh, 780px);
  color: var(--white);
  /* Navy stays visible while the photo loads, and behind it if it fails */
  background-color: var(--navy);
  /* Scrim: heavy on the left where the copy sits, clearing to the right
     so the roofer stays visible. Navy-tinted rather than plain black to
     keep the photo on-brand. Held in a custom property so the WebP
     override below doesn't have to restate it. Gradients are universally
     supported, so this substitution is always valid. */
  --hero-scrim: linear-gradient(
    100deg,
    rgba(6, 21, 57, 0.95) 0%,
    rgba(6, 21, 57, 0.88) 32%,
    rgba(10, 36, 99, 0.62) 62%,
    rgba(10, 36, 99, 0.42) 100%
  );
  background-image: var(--hero-scrim), url("Assets/Images/hero-roofer-1920.jpg");
  background-size: cover;
  background-position: 62% 42%;
  background-repeat: no-repeat;
}

/* WebP where the browser both supports the format and can be asked about
   it via image-set() type(). Anything older keeps the JPEG above. The
   @supports guard is load-bearing: if image-set() were substituted into a
   browser that can't parse it, the whole background-image -- scrim
   included -- would be dropped. */
@supports (background-image: image-set(url("i.webp") type("image/webp"))) {
  .hero {
    background-image:
      var(--hero-scrim),
      image-set(
        url("Assets/Images/hero-roofer-1920.webp") type("image/webp"),
        url("Assets/Images/hero-roofer-1920.jpg") type("image/jpeg")
      );
  }
}

/* Red roofline sliver along the bottom edge */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background-color: var(--red);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 5.5rem 2rem 4.5rem;
}

/* Text sits over a photo now -- a soft shadow guarantees legibility
   even where the sky behind it is bright. */
.hero-title,
.hero-sub {
  text-shadow: 0 2px 12px rgba(6, 21, 57, 0.55);
}

.hero-eyebrow {
  display: inline-block;
  margin-bottom: 1.25rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #ffd7de;
  background-color: rgba(200, 16, 46, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.hero-title {
  max-width: 16ch;
  font-size: clamp(2.4rem, 6vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -1px;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-sub {
  max-width: 52ch;
  font-size: 1.15rem;
  line-height: 1.7;
  color: #d6ddf0;
  margin-bottom: 2.25rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.btn {
  display: inline-block;
  padding: 1rem 1.9rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  border-radius: 4px;
  border: 2px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  color: var(--white);
  background-color: var(--red);
}

.btn--primary:hover,
.btn--primary:focus {
  background-color: #a20d26;
}

.btn--ghost {
  color: var(--white);
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.5);
}

.btn--ghost:hover,
.btn--ghost:focus {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--white);
}

.btn-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: #b9c4e0;
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  list-style: none;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-trust li {
  position: relative;
  padding-left: 1.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #eef1f9;
}

/* Red check mark drawn in CSS -- no icon font needed */
.hero-trust li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 0.45rem;
  height: 0.8rem;
  border: solid var(--red);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

@media (max-width: 560px) {
  .hero {
    min-height: 0;
    /* Narrow viewport crops hard -- go darker and near-uniform so the
       stacked copy stays readable wherever the crop lands. */
    --hero-scrim: linear-gradient(
      180deg,
      rgba(6, 21, 57, 0.92) 0%,
      rgba(6, 21, 57, 0.86) 60%,
      rgba(6, 21, 57, 0.92) 100%
    );
    background-image: var(--hero-scrim), url("Assets/Images/hero-roofer-960.jpg");
    background-position: 58% center;
  }

  @supports (background-image: image-set(url("i.webp") type("image/webp"))) {
    .hero {
      background-image:
        var(--hero-scrim),
        image-set(
          url("Assets/Images/hero-roofer-960.webp") type("image/webp"),
          url("Assets/Images/hero-roofer-960.jpg") type("image/jpeg")
        );
    }
  }

  .hero-inner {
    padding: 3.5rem 1.5rem 3rem;
  }

  .btn {
    width: 100%;
    text-align: center;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background-color: #061539;
  color: #c7d0e8;
  border-top: 5px solid var(--red);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  max-width: 1140px;
  margin: 0 auto;
  padding: 3.5rem 2rem 2.5rem;
}

@media (min-width: 640px) {
  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 940px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr 1.3fr;
    gap: 3rem;
  }
}

.footer-logo {
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--white);
  margin-bottom: 0.9rem;
}

.footer-tagline {
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 34ch;
}

.footer-license {
  margin-top: 1.1rem;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
  color: #8d9ac0;
}

.footer-heading {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.55rem;
}

.footer-col a {
  font-size: 0.94rem;
  color: #c7d0e8;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-col a:hover,
.footer-col a:focus {
  color: var(--white);
  text-decoration: underline;
}

.footer-col address,
.footer-col p {
  font-style: normal;
  font-size: 0.94rem;
  line-height: 1.7;
  margin-bottom: 0.55rem;
}

.footer-hours {
  margin-top: 0.9rem;
  font-size: 0.86rem;
  color: #8d9ac0;
}

.footer-bottom {
  max-width: 1140px;
  margin: 0 auto;
  padding: 1.5rem 2rem 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
  color: #8d9ac0;
}

.footer-disclaimer {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.6;
  font-style: italic;
  color: #7885ab;
}

.footer-credit {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #7885ab;
}

.footer-credit a {
  color: #9fadd4;
  text-decoration: underline;
}

.footer-credit a:hover,
.footer-credit a:focus {
  color: var(--white);
}
