/* ==========================================================================
   SmartHive Home: redesign layer (home.html only, loaded last)
   Sections: hero, system, problem, services, why, proof.
   Classes are prefixed hm-. The header, footer and shared CTA band are untouched.
   Reveal: the page's [data-reveal] observer adds .visible; --d staggers items.
   ========================================================================== */

#smarthive-landing main {
  --hm-ease: cubic-bezier(.22, 1, .36, 1);
  --hm-radius: 22px;
  --hm-gold-text: #9a6a1f;
  --type-h2: clamp(2.1rem, 3.4vw, 3.2rem);
}
@media (max-width: 768px) {
  #smarthive-landing main { --type-h2: clamp(1.95rem, 8vw, 2.5rem); }
}
#smarthive-landing .hm-system,
#smarthive-landing .hm-problem,
#smarthive-landing .hm-services,
#smarthive-landing .hm-why,
#smarthive-landing .hm-proof { padding: 108px 0; }
@media (max-width: 1024px) {
  #smarthive-landing .hm-system,
  #smarthive-landing .hm-problem,
  #smarthive-landing .hm-services,
  #smarthive-landing .hm-why,
  #smarthive-landing .hm-proof { padding: 84px 0; }
}
@media (max-width: 680px) {
  #smarthive-landing .hm-system,
  #smarthive-landing .hm-problem,
  #smarthive-landing .hm-services,
  #smarthive-landing .hm-why,
  #smarthive-landing .hm-proof { padding: 64px 0; }
}

/* Staggered reveal: opacity/transform wait for --d; hover properties respond at once. */
#smarthive-landing main [data-reveal] {
  transition:
    opacity .75s var(--hm-ease) calc(var(--d, 0) * 90ms),
    transform .75s var(--hm-ease) calc(var(--d, 0) * 90ms),
    translate .35s var(--hm-ease),
    box-shadow .35s ease,
    border-color .35s ease,
    background-color .35s ease,
    color .35s ease;
}

/* Without JavaScript nothing waits for the observer. */
html:not(.js) #smarthive-landing [data-reveal],
html:not(.js) .hm-stage,
html:not(.js) .hm-funnel svg > g:first-child > * { opacity: 1; transform: none; translate: none; scale: none; }
html:not(.js) .hm-stage .hm-stage__dot { scale: none; }
html:not(.js) .hm-stages::before { transform: none; }

/* Section headings */
.hm-head { max-width: 720px; margin-bottom: 52px; }
.hm-head .lead { margin: 0; }
.hm-head--center { margin-inline: auto; text-align: center; }
.hm-head--split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 48px;
  align-items: end;
  max-width: none;
}
.hm-head--split h2 { margin-bottom: 0; }
.hm-head__aside { max-width: 400px; margin: 0 0 6px auto; color: var(--muted); font-size: 1rem; line-height: 1.7; }

/* Text link with an arrow */
.hm-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--green);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 3px;
  transition: background-size .35s var(--hm-ease), color .25s ease;
}
.hm-link i { color: var(--gold); transition: transform .3s var(--hm-ease); }
.hm-link:hover { background-size: 100% 1px; }
.hm-link:hover i { transform: translateX(4px); }
.hm-link--light { color: #fff; }

/* --------------------------------------------------------------------------
   1. HERO
   -------------------------------------------------------------------------- */
#smarthive-landing .hm-hero-copy .lead { max-width: 560px; margin-bottom: 30px; }
.hm-btn-primary { background: var(--green); box-shadow: 0 12px 26px -12px rgba(42, 93, 74, .55); }
.hm-btn-primary:hover { background: #224d3d; box-shadow: 0 16px 32px -12px rgba(42, 93, 74, .6); }
@media (prefers-reduced-motion: no-preference) {
  .hm-in { animation: hm-rise .9s var(--hm-ease) backwards; animation-delay: calc(var(--i, 0) * 110ms + 80ms); }
  .hm-in--visual { animation-name: hm-settle; animation-duration: 1.1s; }
}
@keyframes hm-rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes hm-settle { from { opacity: 0; transform: scale(.965) translateY(14px); } }
/* --------------------------------------------------------------------------
   2. SYSTEM (dark): six connected stages
   -------------------------------------------------------------------------- */
#smarthive-landing .hm-system {
  position: relative;
  background:
    radial-gradient(900px 420px at 50% -8%, rgba(67, 213, 161, .10), transparent 65%),
    var(--navy);
}
#smarthive-landing .hm-system h2 { color: #fff !important; }
.hm-system .hm-head .lead { color: #aebec8; }

.hm-stages {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
/* Connector between the first and last dot; draws in on reveal. */
.hm-stages::before {
  content: "";
  position: absolute;
  top: 27px;
  left: calc(100% / 12);
  right: calc(100% / 12);
  height: 1px;
  background: linear-gradient(90deg, rgba(67, 213, 161, .75), rgba(201, 138, 44, .75));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.6s var(--hm-ease) .35s;
}
.hm-stages.visible::before { transform: scaleX(1); }

.hm-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.hm-stage__dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(67, 213, 161, .35);
  border-radius: 50%;
  background: #10212d;
  color: var(--emerald);
  font-size: 1rem;
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, transform .45s var(--hm-ease), box-shadow .35s ease;
}
.hm-stage__card {
  flex: 1;
  width: 100%;
  padding: 22px 16px 24px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  background: rgba(255, 255, 255, .03);
  transition: background-color .35s ease, border-color .35s ease, translate .35s var(--hm-ease);
}
.hm-stage small { display: block; margin-bottom: 6px; color: var(--gold); font-size: .68rem; font-weight: 800; letter-spacing: .16em; }
#smarthive-landing .hm-stage h3 { margin: 0 0 8px; color: #fff; font-size: 1.22rem; }
.hm-stage p { margin: 0; color: #aebec8; font-size: .84rem; line-height: 1.55; }
.hm-stage:hover .hm-stage__card { background: rgba(255, 255, 255, .06); border-color: rgba(67, 213, 161, .3); translate: 0 -4px; }
.hm-stage:hover .hm-stage__dot { background: var(--emerald); color: var(--navy); border-color: var(--emerald); transform: scale(1.08); box-shadow: 0 0 0 8px rgba(67, 213, 161, .12); }

/* Stages arrive one after another once the list is revealed. */
@media (prefers-reduced-motion: no-preference) {
  .hm-stage { opacity: 0; translate: 0 18px; transition: opacity .7s var(--hm-ease), translate .7s var(--hm-ease); transition-delay: calc(var(--d, 0) * 120ms + 200ms); }
  .hm-stage .hm-stage__dot { scale: .6; transition: scale .6s var(--hm-ease) calc(var(--d, 0) * 120ms + 260ms), background-color .35s ease, color .35s ease, border-color .35s ease, transform .45s var(--hm-ease), box-shadow .35s ease; }
  .hm-stages.visible .hm-stage { opacity: 1; translate: 0 0; }
  .hm-stages.visible .hm-stage__dot { scale: 1; }
  #smarthive-landing main .hm-stages[data-reveal] { transform: none; }
}

.hm-system__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  margin-top: 48px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.hm-system__foot p { display: flex; align-items: center; gap: 12px; margin: 0; color: #aebec8; font-size: .92rem; }
.hm-system__foot p i { color: var(--emerald); }
.hm-system__foot b { color: #fff; }

/* --------------------------------------------------------------------------
   3. PROBLEM / OPPORTUNITY
   -------------------------------------------------------------------------- */
.hm-problem__grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(40px, 6vw, 72px);
}
.hm-problem__copy .lead { margin-bottom: 0; }
.hm-leaks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0 28px;
  padding: 0;
  list-style: none;
}
.hm-leak {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--cream);
}
.hm-leak > i {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold-light);
  color: var(--gold);
  font-size: .85rem;
  transition: background-color .3s ease, color .3s ease;
}
.hm-leak span { color: var(--muted); font-size: .8rem; line-height: 1.45; }
.hm-leak strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: .9rem; }
.hm-leak:hover { translate: 0 -3px; border-color: rgba(201, 138, 44, .45); background-color: #fff; box-shadow: 0 14px 28px -18px rgba(12, 26, 36, .3); }
.hm-leak:hover > i { background: var(--gold); color: #fff; }

#smarthive-landing .hm-funnel {
  padding: clamp(24px, 3.5vw, 40px) clamp(20px, 3vw, 36px) 28px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(180deg, #fff, var(--cream));
  box-shadow: 0 30px 70px -40px rgba(12, 26, 36, .35);
}
#smarthive-landing .hm-funnel figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px 12px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  color: var(--ink);
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
#smarthive-landing .hm-funnel figcaption::before { display: none; }
.hm-funnel__tag {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--gold-light);
  color: var(--hm-gold-text);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
/* Funnel bars widen into place one by one. */
@media (prefers-reduced-motion: no-preference) {
  .hm-funnel svg > g:first-child > * {
    opacity: 0;
    transform: scaleX(.55);
    transform-box: fill-box;
    transform-origin: center;
    transition: opacity .6s var(--hm-ease), transform .8s var(--hm-ease);
  }
  .hm-funnel.visible svg > g:first-child > * { opacity: 1; transform: none; }
  .hm-funnel svg > g:first-child > :nth-child(3), .hm-funnel svg > g:first-child > :nth-child(4) { transition-delay: .12s; }
  .hm-funnel svg > g:first-child > :nth-child(5), .hm-funnel svg > g:first-child > :nth-child(6) { transition-delay: .24s; }
  .hm-funnel svg > g:first-child > :nth-child(7), .hm-funnel svg > g:first-child > :nth-child(8) { transition-delay: .36s; }
  .hm-funnel svg > g:first-child > :nth-child(9), .hm-funnel svg > g:first-child > :nth-child(10) { transition-delay: .48s; }
}

/* --------------------------------------------------------------------------
   4. SERVICES: three solution cards (middle card featured)
   -------------------------------------------------------------------------- */
#smarthive-landing .hm-services { background: var(--cream); }
.hm-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.hm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 32px 30px 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--hm-radius);
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
}
.hm-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--hm-ease);
}
.hm-card:hover { translate: 0 -6px; border-color: rgba(42, 93, 74, .25); box-shadow: 0 28px 50px -28px rgba(12, 26, 36, .35); }
.hm-card:hover::before { transform: scaleX(1); }
.hm-card__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: var(--green-light);
  color: var(--green);
  font-size: 1.15rem;
  transition: background-color .35s ease, color .35s ease, transform .45s var(--hm-ease);
}
.hm-card:hover .hm-card__icon { background: var(--green); color: #fff; transform: rotate(-8deg) scale(1.05); }
.hm-card small { margin: 24px 0 8px; color: var(--hm-gold-text); font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
#smarthive-landing .hm-card h3 { margin: 0 0 10px; font-size: 1.5rem; }
.hm-card p { margin: 0 0 22px; color: var(--muted); font-size: .93rem; line-height: 1.65; }
.hm-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 26px; padding: 0; list-style: none; }
.hm-pills li { padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--cream); color: var(--ink); font-size: .72rem; font-weight: 600; }
.hm-card__more { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; color: var(--green); font-size: .86rem; font-weight: 700; }
.hm-card__more i { color: var(--gold); transition: transform .3s var(--hm-ease); }
.hm-card:hover .hm-card__more i { transform: translateX(5px); }

.hm-card--feature { border-color: transparent; background: var(--navy); color: #fff; }
#smarthive-landing .hm-card--feature h3 { color: #fff; }
.hm-card--feature p { color: #aebec8; }
.hm-card--feature small { color: var(--gold); }
.hm-card--feature .hm-card__icon { background: rgba(67, 213, 161, .12); color: var(--emerald); }
.hm-card--feature:hover .hm-card__icon { background: var(--emerald); color: var(--navy); }
.hm-card--feature .hm-pills li { border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); color: #dfe7ec; }
.hm-card--feature .hm-card__more { color: var(--emerald); }
.hm-card--feature:hover { border-color: transparent; box-shadow: 0 30px 56px -26px rgba(12, 26, 36, .6); }

/* --------------------------------------------------------------------------
   5. WHY SMARTHIVE: differentiator cards
   -------------------------------------------------------------------------- */
#smarthive-landing .hm-why { border-top: 1px solid var(--line); background: var(--white); }
.hm-why .hm-head { margin-bottom: 44px; }
.hm-why__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.hm-diff {
  position: relative;
  padding: 30px 30px 32px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--hm-radius);
  background: var(--cream);
}
.hm-diff__num {
  position: absolute;
  top: 10px;
  right: 22px;
  color: rgba(42, 93, 74, .09);
  font-family: var(--serif);
  font-size: 4.6rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.04em;
  transition: color .4s ease, transform .5s var(--hm-ease);
}
.hm-diff__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 26px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--green);
  transition: background-color .35s ease, color .35s ease, border-color .35s ease;
}
#smarthive-landing .hm-diff h3 { margin: 0 0 10px; font-size: 1.35rem; }
.hm-diff p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.65; }
.hm-diff:hover { translate: 0 -5px; background-color: #fff; box-shadow: 0 26px 48px -30px rgba(12, 26, 36, .35); }
.hm-diff:hover .hm-diff__num { color: rgba(201, 138, 44, .22); transform: translateY(-4px); }
.hm-diff:hover .hm-diff__icon { background: var(--green); border-color: var(--green); color: #fff; }

/* --------------------------------------------------------------------------
   6. PROOF: case study highlight card
   -------------------------------------------------------------------------- */
#smarthive-landing .hm-proof { position: relative; background: var(--cream-deep); }
.hm-case {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--white);
  box-shadow: 0 40px 90px -50px rgba(12, 26, 36, .4);
}
.hm-case__photo { position: relative; min-height: 100%; margin: 0; overflow: hidden; }
.hm-case__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transition: transform 1.2s var(--hm-ease); }
.hm-case:hover .hm-case__photo img { transform: scale(1.04); }
.hm-case__body { padding: clamp(32px, 4.6vw, 60px); }
#smarthive-landing .hm-case__body h2 { margin-bottom: 26px; font-size: clamp(1.85rem, 2.7vw, 2.55rem) !important; }
.hm-case__steps { margin: 0; padding: 0; list-style: none; }
.hm-case__steps li {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.hm-case__steps b { padding-top: 2px; color: var(--green); font-size: .68rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hm-case__steps span { color: var(--muted); font-size: .9rem; line-height: 1.55; }
.hm-case__stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 24px; }
.hm-stat {
  flex: 1 1 150px;
  padding: 18px 22px;
  border-radius: 16px;
  background: var(--navy);
  transition: translate .35s var(--hm-ease);
}
.hm-stat:hover { translate: 0 -3px; }
.hm-stat b { display: block; color: #e5a84b; font-family: var(--serif); font-size: 2.6rem; font-weight: 500; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hm-stat span { display: block; margin-top: 6px; color: #aebec8; font-size: .78rem; }
.hm-case__note { display: flex; flex-basis: 100%; align-items: center; gap: 8px; margin: 2px 0 0; color: var(--green); font-size: .85rem; font-weight: 600; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .hm-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 28px; }
  .hm-stages::before { display: none; }
  .hm-card { padding: 28px 24px 24px; }
}
@media (max-width: 992px) {
  .hm-problem__grid { grid-template-columns: 1fr; }
  .hm-case { grid-template-columns: 1fr; }
  .hm-case__photo { min-height: 320px; }
}
@media (max-width: 860px) {
  .hm-head--split { grid-template-columns: 1fr; gap: 16px; }
  .hm-head__aside { margin: 0; }
  .hm-cards, .hm-why__grid { grid-template-columns: 1fr; max-width: 620px; }
  .hm-head { margin-bottom: 40px; }
}
@media (max-width: 680px) {
  /* Vertical timeline on phones */
  .hm-stages { grid-template-columns: 1fr; row-gap: 14px; }
  .hm-stages::before { display: block; top: 27px; bottom: 27px; left: 27px; right: auto; width: 1px; height: auto; background: linear-gradient(180deg, rgba(67, 213, 161, .75), rgba(201, 138, 44, .75)); transform: scaleY(0); transform-origin: top; }
  .hm-stages.visible::before { transform: scaleY(1); }
  .hm-stage { flex-direction: row; align-items: flex-start; gap: 16px; text-align: left; }
  .hm-stage__dot { flex: 0 0 54px; }
  .hm-stage__card { padding: 16px 18px; }
  .hm-system__foot { flex-direction: column; align-items: flex-start; }
  .hm-system__foot p { align-items: flex-start; }
  .hm-system__foot p i { margin-top: 4px; }
  .hm-case__photo { min-height: 260px; }
  .hm-case__steps li { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 560px) {
  .hm-leaks { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  #smarthive-landing main [data-reveal] { transition: none; }
  .hm-stages::before { transform: none; transition: none; }
  .hm-card, .hm-diff, .hm-leak, .hm-stat, .hm-stage__card, .hm-case__photo img { transition: none; }
}

/* --------------------------------------------------------------------------
   HERO SCALE (desktop and up): wider container, larger carousel, taller hero.
   Mobile and tablet keep the layouts defined above.
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) {
  #smarthive-landing .hero {
    min-height: clamp(720px, calc(100vh - 72px), 860px);
    padding: 56px 0 64px;
  }
  #smarthive-landing .hero > .container {
    width: min(calc(100% - 64px), 1320px);
  }
  #smarthive-landing .hero-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
    gap: clamp(56px, 6vw, 96px);
  }
  #smarthive-landing .hm-hero-copy h1 { font-size: clamp(3rem, 4.6vw, 4.6rem); max-width: 660px; }
  #smarthive-landing .hero-visual {
    min-height: 0;
    height: auto;
    width: 100%;
    max-width: 580px;
    justify-self: end;
  }
  #smarthive-landing .hero-photo {
    height: clamp(500px, 66vh, 600px);
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 24px;
  }
  #smarthive-landing .hero-photo img { object-position: center 25%; }
  #smarthive-landing .home-hero-carousel__controls { padding: 72px 22px 20px; }
}
@media (min-width: 1025px) and (max-width: 1279px) {
  #smarthive-landing .hero-visual { max-width: 520px; }
  #smarthive-landing .hero-photo { height: clamp(460px, 62vh, 560px); }
}
@media (prefers-reduced-motion: no-preference) {
  /* Crossfade 1.6s -> 1.0s, within the 800-1100ms target. Timing is CSS only. */
  #smarthive-landing .home-hero-carousel__slide { transition-duration: 1000ms; }
}
