/* ==========================================================================
   PAGE: Home
   Each block maps to one BEGIN/END SECTION in home.html. Shared pieces
   (CTA split, areas, projects, articles, FAQs) live in their own files.
   ========================================================================== */

/* ----- Hero ----- */
.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--hero-banner-background-color);
  color: var(--text-on-dark);
  padding-block: clamp(80px, 10vw, 140px) clamp(150px, 15vw, 210px);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--slant)), 50% 100%, 0 calc(100% - var(--slant)));

  .home-hero-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
  }

  &::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
      linear-gradient(90deg, color-mix(in srgb, var(--hero-banner-background-color) 92%, transparent) 0%, color-mix(in srgb, var(--hero-banner-background-color) 70%, transparent) 45%, color-mix(in srgb, var(--hero-banner-background-color) 15%, transparent) 100%),
      linear-gradient(0deg, color-mix(in srgb, var(--hero-banner-background-color) 60%, transparent), transparent 40%);
  }

  .home-hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
    align-items: end;
    gap: 48px;
  }

  .eyebrow {
    color: var(--primary-color);
  }

  .home-hero-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 7vw, 5.6rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.035em;

    &.home-hero-title--accent {
      margin-bottom: 22px;
      color: var(--primary-color);
    }
  }

  .home-hero-lead {
    max-width: 46ch;
    margin-bottom: 30px;
    font-size: 1.15rem;
    color: var(--text-on-dark-muted);
  }

  .home-hero-card {
    padding: 28px;
    background: color-mix(in srgb, var(--hero-banner-background-color) 55%, transparent);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-on-dark);
    border-top: 4px solid var(--primary-color);
    border-radius: var(--radius-lg);

    .home-hero-card-icon {
      display: grid;
      place-items: center;
      width: 48px;
      height: 48px;
      margin-bottom: 16px;
      font-size: 1.4rem;
      color: var(--secondary-color);
      background: var(--primary-color);
      border-radius: 50%;
    }

    .home-hero-card-title {
      margin-bottom: 8px;
      font-family: var(--font-heading);
      font-size: 1.3rem;
      font-weight: 700;
      line-height: 1.25;
      color: var(--text-on-dark);
    }

    p {
      color: var(--text-on-dark-muted);
    }

    ul {
      margin: 18px 0 0;
      padding: 16px 0 0;
      list-style: none;
      border-top: 1px solid var(--border-on-dark);
      font-size: 0.93rem;
    }

    li {
      display: flex;
      gap: 10px;

      + li {
        margin-top: 6px;
      }
    }

    li i {
      color: var(--primary-color);
    }
  }
}

/* ----- Priority (overlaps the hero) ----- */
.home-priority {
  position: relative;
  z-index: 2;
  margin-top: calc(-1 * clamp(110px, 11vw, 150px));

  .home-priority-panel {
    display: grid;
    grid-template-columns: 0.75fr 3fr;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .home-priority-heading {
    display: flex;
    align-items: flex-end;
    margin: 0;
    padding: 32px;
    font-size: clamp(1.5rem, 2.2vw, 1.9rem);
    color: var(--secondary-color);
    background: var(--primary-color);
  }

  .home-priority-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .home-priority-item {
    padding: 32px 28px;

    + .home-priority-item {
      border-left: 1px solid var(--border-color);
    }

    i {
      display: block;
      margin-bottom: 14px;
      font-size: 2rem;
      color: var(--primary-strong);
    }

    h3 {
      font-size: 1.12rem;
    }

    p {
      margin: 0;
      font-size: 0.97rem;
      color: var(--text-muted);
    }
  }
}

/* ----- Intro (H1) ----- */
.home-intro {
  padding-block: var(--section-space);

  .home-intro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: clamp(40px, 6vw, 88px);
  }

  .home-intro-media {
    position: relative;
    padding: 0 12% 18% 0;
  }

  .home-intro-img-main {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-lg);
  }

  .home-intro-img-inset {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 52%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 8px solid var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
  }

  .home-intro-mark {
    position: absolute;
    left: -22px;
    bottom: 8%;
    width: 120px;
    height: 104px;
    background: var(--primary-color);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    z-index: -1;
  }

  h1 {
    font-size: clamp(2rem, 3.6vw, 2.9rem);
  }

  .home-intro-content > p {
    color: var(--text-muted);
  }

  .home-intro-facts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 30px 0;

    div {
      padding: 18px;
      background: white;
      border-radius: var(--radius);
      border-bottom: 3px solid var(--primary-color);
    }

    dt {
      font-family: var(--font-heading);
      font-size: 2rem;
      font-weight: 800;
      line-height: 1;
    }

    dd {
      margin: 8px 0 0;
      font-size: 0.88rem;
      line-height: 1.4;
      color: var(--text-muted);
    }
  }
}

/* ----- Services (bento grid) ----- */
.home-services {
  padding-block: var(--section-space);
  background: white;

  .home-services-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: minmax(250px, auto);
    gap: 18px;
  }

  .service-tile {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border-radius: var(--radius-lg);
    color: var(--text-on-dark);
    grid-column: span 4;

    > img {
      position: absolute;
      inset: 0;
      z-index: -2;
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.5s ease;
    }

    &::before {
      content: "";
      position: absolute;
      inset: 0;
      z-index: -1;
      background: linear-gradient(0deg, color-mix(in srgb, var(--secondary-color) 95%, transparent) 20%, color-mix(in srgb, var(--secondary-color) 55%, transparent) 60%, color-mix(in srgb, var(--secondary-color) 10%, transparent) 100%);
    }

    &:hover > img {
      transform: scale(1.05);
    }

    .service-tile-body {
      padding: 26px;
    }

    h3 {
      margin-bottom: 8px;
      font-size: 1.45rem;
    }

    /* Whole tile is clickable through an empty overlay link */
    .service-tile-link {
      position: absolute;
      inset: 0;
      z-index: 1;

      &::after {
        content: "\F138";
        position: absolute;
        top: 22px;
        right: 22px;
        font-family: "bootstrap-icons";
        font-size: 1.3rem;
        color: var(--primary-color);
      }
    }

    .service-tile-more {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 18px;
      font-weight: 700;
      text-decoration: none;
      color: var(--primary-color);

      &:hover {
        color: var(--text-on-dark);
      }
    }

    p {
      margin: 0;
      font-size: 0.97rem;
      color: var(--text-on-dark-muted);
    }
  }

  .service-tile-feature {
    grid-column: span 7;
    grid-row: span 2;

    h3 {
      font-size: clamp(1.8rem, 3vw, 2.4rem);
    }

    .service-tile-tag {
      display: inline-block;
      margin-bottom: 12px;
      padding: 4px 12px;
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--secondary-color);
      background: var(--primary-color);
      border-radius: 99px;
    }

    > .service-tile-body > p {
      max-width: 52ch;
      margin-bottom: 20px;
    }
  }

  .service-chips {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;

    a {
      display: inline-block;
      padding: 7px 14px;
      font-size: 0.85rem;
      font-weight: 600;
      text-decoration: none;
      color: var(--text-on-dark);
      background: color-mix(in srgb, white 10%, transparent);
      border: 1px solid var(--border-on-dark);
      border-radius: 99px;
      backdrop-filter: blur(6px);

      &:hover {
        color: var(--secondary-color);
        background: var(--primary-color);
        border-color: var(--primary-color);
      }
    }
  }

  .service-tile-feature + .service-tile,
  .service-tile-dark {
    grid-column: span 5;
  }

  .service-tile-dark {
    justify-content: space-between;
    background: var(--secondary-color);

    &::before {
      content: none;
    }

    > i {
      padding: 26px 26px 0;
      font-size: 2.6rem;
      color: var(--accent-color);
    }
  }

  .home-services-foot {
    margin-top: 36px;
    text-align: center;
  }
}


/* ----- Materials ----- */
.home-materials {
  padding-block: var(--section-space);

  .home-materials-grid {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    align-items: center;
    gap: clamp(40px, 6vw, 80px);
  }

  h2 {
    font-size: clamp(2rem, 3.6vw, 2.8rem);
  }

  .home-materials-content p {
    color: var(--text-muted);
  }

  .home-materials-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;

    li {
      display: flex;
      flex-direction: column;
      gap: 18px;
      padding: 26px;
      background: white;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      transition: border-color 0.2s ease, transform 0.2s ease;

      &:hover {
        border-color: var(--primary-color);
        transform: translateY(-3px);
      }
    }

    img {
      height: 64px;
      width: auto;
      max-width: 170px;
      object-fit: contain;
      object-position: left center;
    }

    h3 {
      margin-bottom: 2px;
      font-size: 1.1rem;
    }

    p {
      margin: 0;
      font-size: 0.92rem;
      color: var(--text-muted);
    }
  }
}

/* ----- Local Pros ----- */
.home-local {
  padding-block: var(--section-space);
  background: var(--secondary-color);
  color: var(--text-on-dark);

  .home-local-grid {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: clamp(40px, 6vw, 80px);
  }

  .home-local-media {
    position: relative;
    margin: 0;

    img {
      width: 100%;
      aspect-ratio: 4 / 3;
      object-fit: cover;
      border-radius: var(--radius-lg);
    }

    figcaption {
      position: absolute;
      left: 24px;
      right: 24px;
      bottom: -28px;
      padding: 18px 22px;
      font-family: var(--font-heading);
      font-size: 1.15rem;
      font-weight: 700;
      color: var(--secondary-color);
      background: var(--primary-color);
      border-radius: var(--radius);
    }
  }

  .eyebrow {
    color: var(--primary-color);
  }

  h2 {
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  }

  .home-local-content > p {
    color: var(--text-on-dark-muted);
  }

  .home-local-weather {
    margin: 28px 0 32px;
    padding: 24px;
    border: 1px solid var(--border-on-dark);
    border-radius: var(--radius-lg);

    h3 {
      font-size: 1.15rem;
    }

    ul {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin: 0 0 14px;
      padding: 0;
      list-style: none;
    }

    li {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 6px 14px;
      font-size: 0.9rem;
      background: color-mix(in srgb, white 7%, transparent);
      border-radius: 99px;
    }

    li::before {
      content: "";
      width: 8px;
      height: 8px;
      background: var(--primary-color);
      clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
    }

    p {
      margin: 0;
      font-size: 0.95rem;
      color: var(--text-on-dark-muted);
    }
  }
}

/* ----- Storm CTA ----- */
.home-storm {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(56px, 7vw, 84px);
  background: var(--accent-color);
  color: var(--secondary-color);

  .home-storm-bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: multiply;
    opacity: 0.22;
  }

  /* Hazard stripe along the top edge */
  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 12px;
    background: repeating-linear-gradient(-45deg, var(--secondary-color) 0 16px, transparent 16px 32px);
  }

  .home-storm-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 32px;
  }

  .home-storm-badge {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    font-size: 2.2rem;
    color: var(--accent-color);
    background: var(--secondary-color);
    border-radius: 50%;
  }

  h2 {
    margin-bottom: 8px;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
  }

  p {
    max-width: 58ch;
    margin: 0;
    font-weight: 500;
  }

  .btn-row {
    flex-direction: column;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
  .home-priority {
    .home-priority-panel {
      grid-template-columns: 1fr;
    }

    .home-priority-heading {
      padding: 22px 28px;
    }
  }

  .home-services .home-services-grid {
    .service-tile,
    .service-tile-feature + .service-tile,
    .service-tile-dark {
      grid-column: span 6;
    }

    .service-tile-feature {
      grid-column: span 12;
      grid-row: span 1;
      min-height: 520px;
    }
  }
}

@media (max-width: 900px) {
  .home-hero .home-hero-inner,
  .home-intro .home-intro-grid,
  .home-materials .home-materials-grid,
  .home-local .home-local-grid {
    grid-template-columns: 1fr;
  }

  .home-hero .home-hero-card {
    max-width: 460px;
  }

  .home-storm .home-storm-inner {
    grid-template-columns: 1fr;
    gap: 20px;

    .btn-row {
      flex-direction: row;
    }
  }

  .home-local .home-local-media {
    margin-bottom: 28px;
  }
}

@media (max-width: 640px) {
  .home-priority .home-priority-grid {
    grid-template-columns: 1fr;

    .home-priority-item + .home-priority-item {
      border-left: 0;
      border-top: 1px solid var(--border-color);
    }
  }

  .home-intro .home-intro-facts {
    grid-template-columns: 1fr;

    div {
      display: flex;
      align-items: center;
      gap: 14px;
    }

    dd {
      margin: 0;
    }
  }

  .home-services .home-services-grid {
    .service-tile,
    .service-tile-feature + .service-tile,
    .service-tile-dark,
    .service-tile-feature {
      grid-column: span 12;
    }

    .service-tile-feature {
      min-height: 620px;
    }
  }

  .home-materials .home-materials-list {
    grid-template-columns: 1fr;
  }
}
