/* ==========================================================================
   Direct Homes – Homepage elegance + motion
   - scroll reveals (.dh-reveal → .is-visible, set by js/directhomes-motion.js)
   - hero: staggered text, floating Cockpit card
   - new sections: benefits bar, "not an agent", how it works
   - micro interactions: icon pops, arrow nudges, featured package breathes
   All motion is switched off for "reduce motion" users.
   ========================================================================== */

.dh-home2 {
  --dh-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

/* --------------------------------------------------------------------------
   1. Scroll reveal (hidden only when JS runs: html.dh-motion)
   -------------------------------------------------------------------------- */
html.dh-motion .dh-reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(4px);
  transition:
    opacity 0.9s var(--dh-ease) var(--d, 0s),
    transform 0.9s var(--dh-ease) var(--d, 0s),
    filter 0.9s var(--dh-ease) var(--d, 0s);
}

html.dh-motion .dh-reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* buttons: arrow nudges forward */
.dh-home2 .h2-btn svg,
.dh-home2 .h2-path__circle svg {
  transition: transform 0.35s var(--dh-ease);
}

.dh-home2 .h2-btn:hover svg,
.dh-home2 .h2-btn:focus-visible svg {
  transform: translateX(4px);
}

/* --------------------------------------------------------------------------
   2. Hero – floating Cockpit card
   -------------------------------------------------------------------------- */
html.dh-motion .dh-float.is-visible {
  animation: dh-float 4.2s ease-in-out 1s infinite;
}

@keyframes dh-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

.dh-home2 .h2h__glance {
  transition: box-shadow 0.4s ease;
}

.dh-home2 .h2h__glance:hover {
  box-shadow: 0 40px 80px rgba(var(--dh-primary-rgb), 0.22);
}

/* hero leaves room for the benefits bar */
.dh-home2 .h2h {
  padding-bottom: 70px;
}

/* --------------------------------------------------------------------------
   3. Benefits bar – glass card over the bottom of the hero
   -------------------------------------------------------------------------- */
.h2-benefits {
  position: relative;
  z-index: 3;
  margin-top: -78px;
  /* top half on the hero, bottom half on the white packages section */
  background: linear-gradient(180deg, transparent 0, transparent 78px, #fff 78px);
}

.h2-benefits__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid rgba(var(--dh-sand-rgb), 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 30px 70px rgba(var(--dh-primary-rgb), 0.14);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.h2-benefits__item {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
}

.h2-benefits__item + .h2-benefits__item::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 0;
  width: 1px;
  background: var(--dh-sand);
}

.h2-benefits__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--dh-bg);
  color: var(--dh-primary);
  transition: background-color 0.4s ease, color 0.4s ease, transform 0.5s var(--dh-ease);
}

.h2-benefits__icon svg {
  width: 24px;
  height: 24px;
}

/* hover: only the icon changes colour and tilts */
.h2-benefits__item:hover .h2-benefits__icon {
  background: var(--dh-accent);
  color: #fff;
  transform: rotate(-10deg);
}

.h2-benefits__title {
  margin: 4px 0 6px;
  font-family: var(--dh-font-heading);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--dh-primary);
  text-transform: none;
}

.h2-benefits__text {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: #666;
}

@media (max-width: 1199px) {
  .h2-benefits__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .h2-benefits__item:nth-child(3)::before {
    display: none;
  }
}

@media (max-width: 575px) {
  .h2-benefits {
    margin-top: -40px;
    background: linear-gradient(180deg, transparent 0, transparent 40px, #fff 40px);
  }

  .h2-benefits__list {
    grid-template-columns: 1fr;
  }

  .h2-benefits__item + .h2-benefits__item::before {
    top: 0;
    right: 22px;
    bottom: auto;
    left: 22px;
    width: auto;
    height: 1px;
  }
}

/* packages follow the benefits bar directly */
.dh-home2 .h2-packages {
  padding-top: clamp(48px, 5vw, 80px);
}

/* featured package: breathes softly (scale in / out). Uses the "scale"
   property, so the normal hover lift (transform) still works on top. */
.dh-home2 .h2-packages .dh-plan--featured {
  animation: dh-breathe 3.6s ease-in-out 1.2s infinite;
}

@keyframes dh-breathe {
  0%, 100% { scale: 1; }
  50%      { scale: 1.035; }
}

/* --------------------------------------------------------------------------
   4. Not an agent – comparison table
      One white table card, full container width. Columns:
      label (icon) | traditional agent (muted) | Directhomes (green header,
      light green cells)
   -------------------------------------------------------------------------- */
.h2-vs__table {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--dh-sand);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 30px 70px rgba(var(--dh-primary-rgb), 0.08);
}

.h2-vs__row {
  display: grid;
  grid-template-columns: minmax(200px, 0.75fr) minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: stretch;
}

.h2-vs__row > span {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 30px;
  font-size: 16px;
  line-height: 1.5;
  transition: background-color 0.3s ease;
}

.h2-vs__row + .h2-vs__row > span {
  border-top: 1px solid #EFE9DD;
}

/* label column */
.h2-vs__label {
  font-family: var(--dh-font-heading);
  font-size: 20px !important;
  color: var(--dh-primary);
}

.h2-vs__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--dh-bg);
  color: var(--dh-primary);
  transition: background-color 0.35s ease, color 0.35s ease, transform 0.45s var(--dh-ease);
}

.h2-vs__icon svg {
  width: 20px;
  height: 20px;
}

/* traditional agent column */
.h2-vs__agent {
  background: #FCFBF8;
  color: #9a9a9a;
}

/* Directhomes column */
.h2-vs__us {
  background: #F1F6F4;
  color: var(--dh-primary);
  font-weight: 500;
}

/* header row */
.h2-vs__row--head > span {
  padding-top: 24px;
  padding-bottom: 24px;
}

.h2-vs__row--head .h2-vs__label--head,
.h2-vs__row--head .h2-vs__agent {
  font-family: var(--dh-font-body);
  font-size: 13px !important;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a0a0a0;
}

.h2-vs__row--head .h2-vs__agent {
  background: #F7F4EE;
}

.h2-vs__row--head .h2-vs__us {
  background: var(--dh-primary);
}

.h2-vs__row--head .h2-vs__us .dh-wordmark {
  font-size: 28px;
  color: #fff;
  letter-spacing: 0;
  text-transform: none;
}

.h2-vs__row--head .h2-vs__us .dh-wordmark span {
  color: var(--dh-accent);
}

/* marks */
.h2-vs__mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: transform 0.5s var(--dh-ease) var(--d, 0s);
}

.h2-vs__mark svg {
  width: 14px;
  height: 14px;
}

.h2-vs__mark--no {
  background: #EEEBE5;
  color: #aaa;
}

.h2-vs__mark--yes {
  background: var(--dh-primary);
  color: #fff;
}

/* row hover: the whole row lights up a little */
.h2-vs__row:not(.h2-vs__row--head):hover .h2-vs__label {
  background: #FBF9F5;
}

.h2-vs__row:not(.h2-vs__row--head):hover .h2-vs__agent {
  background: #F8F6F1;
}

.h2-vs__row:not(.h2-vs__row--head):hover .h2-vs__us {
  background: #E6EFEB;
}

.h2-vs__row:hover .h2-vs__icon {
  background: var(--dh-primary);
  color: #fff;
  transform: rotate(-6deg);
}

/* ticks pop in one after the other once the table is visible */
html.dh-motion .h2-vs__table.dh-reveal .h2-vs__mark--yes {
  transform: scale(0);
}

html.dh-motion .h2-vs__table.dh-reveal.is-visible .h2-vs__mark--yes {
  transform: scale(1);
}

@media (max-width: 991px) {
  .h2-vs__row {
    grid-template-columns: minmax(150px, 0.7fr) minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .h2-vs__row > span {
    padding: 18px 18px;
    font-size: 15px;
  }

  .h2-vs__icon {
    width: 38px;
    height: 38px;
  }
}

/* phones: label on its own line, agent and Directhomes side by side below */
@media (max-width: 767px) {
  .h2-vs__row {
    grid-template-columns: 1fr 1fr;
  }

  .h2-vs__row--head .h2-vs__label--head {
    display: none;
  }

  .h2-vs__label {
    grid-column: 1 / -1;
    padding: 16px 16px 10px !important;
    font-size: 18px !important;
  }

  .h2-vs__row + .h2-vs__row > .h2-vs__agent,
  .h2-vs__row + .h2-vs__row > .h2-vs__us {
    border-top: 0;
  }

  .h2-vs__row > .h2-vs__agent,
  .h2-vs__row > .h2-vs__us {
    align-items: flex-start;
    padding: 12px 14px 16px;
    font-size: 14px;
  }

  .h2-vs__row--head > span {
    padding: 16px 14px !important;
  }

  .h2-vs__row--head .h2-vs__us .dh-wordmark {
    font-size: 20px;
  }

  .h2-vs__mark {
    width: 24px;
    height: 24px;
  }
}

/* --------------------------------------------------------------------------
   5. How it works – four step cards (same family as the "Why choose us" cards)
   -------------------------------------------------------------------------- */
.h2-steps__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  counter-reset: none;
}

.h2-step {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 30px 28px 32px;
  overflow: hidden;
  border: 1px solid var(--dh-sand);
  border-radius: 18px;
  background: #fff;
  transition: transform 0.45s var(--dh-ease), box-shadow 0.45s var(--dh-ease), border-color 0.45s ease;
}

/* gold line grows along the top edge on hover */
.h2-step::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--dh-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.6s var(--dh-ease);
}

.h2-step:hover {
  transform: translateY(-8px);
  border-color: rgba(var(--dh-accent-rgb), 0.45);
  box-shadow: 0 24px 50px rgba(var(--dh-primary-rgb), 0.1);
}

.h2-step:hover::before {
  transform: scaleX(1);
}

.h2-step__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 26px;
}

.h2-step__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--dh-bg);
  color: var(--dh-primary);
  transition: background-color 0.45s ease, color 0.45s ease, transform 0.5s var(--dh-ease);
}

.h2-step__icon svg {
  width: 26px;
  height: 26px;
}

.h2-step:hover .h2-step__icon {
  background: var(--dh-primary);
  color: #fff;
  transform: rotate(-8deg) scale(1.06);
}

.h2-step__num {
  font-family: var(--dh-font-heading);
  font-size: 46px;
  line-height: 1;
  color: rgba(var(--dh-accent-rgb), 0.3);
  transition: color 0.45s ease, transform 0.5s var(--dh-ease);
}

.h2-step:hover .h2-step__num {
  color: var(--dh-accent);
  transform: translateY(-3px);
}

.h2-step__title {
  margin: 0 0 12px;
  font-family: var(--dh-font-heading);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.25;
  color: var(--dh-primary);
  text-transform: none;
}

.h2-step__text {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: #666;
}

@media (max-width: 1199px) {
  .h2-steps__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .h2-steps__grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   7. Small refinements on existing sections
   -------------------------------------------------------------------------- */
/* testimonial section: dotted background when it is a "dots" section */
body.dh-home2 section.testimonials.dh-testimonials.h2-reviews.h2-bg-dots {
  background-color: var(--dh-bg);
  background-image: radial-gradient(rgba(var(--dh-primary-rgb), 0.12) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* PROFI service cards: icon reacts on hover */
.dh-home2 .h2-service .h2-icon-badge {
  transition: background-color 0.4s ease, color 0.4s ease, transform 0.5s var(--dh-ease);
}

.dh-home2 .h2-service:hover .h2-icon-badge {
  background: var(--dh-accent);
  color: #fff;
  transform: rotate(-8deg) scale(1.06);
}

/* --------------------------------------------------------------------------
   8. Reduce motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  html.dh-motion .dh-reveal {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }

  html.dh-motion .dh-float.is-visible,
  .dh-home2 .h2-packages .dh-plan--featured {
    animation: none;
  }

  html.dh-motion .h2-vs__table.dh-reveal .h2-vs__mark--yes {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   9. Hero Cockpit card: clearly an example of the user's own Cockpit
   -------------------------------------------------------------------------- */
.h2h__glance .h2h__glance-badge {
  flex: 0 0 auto;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--dh-accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
}

.h2h__glance-steps .h2h__glance-cap {
  display: block;
  padding: 2px 0 6px;
  border: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8a8a8a;
}

.h2h__glance-foot {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(var(--dh-primary-rgb), 0.08);
  font-size: 13px;
  line-height: 1.5;
  color: #6b6b6b;
}
