/*
  Sparkns Racks — Homepage trust sections.
  Prefix: hm- (homepage)
  Sections: Who We Are · Why Choose · Workflow · Promise
*/

/* ================================================== */
/* Reveal baseline                                      */
/* ================================================== */

.hm-reveal {
  opacity: 0;
  transform: translateY(44px);
}
.hm-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1),
              transform 0.7s cubic-bezier(0.4,0,0.2,1);
}
.hm-reveal-left {
  opacity: 0;
  transform: translateX(-44px);
}
.hm-reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.75s cubic-bezier(0.4,0,0.2,1),
              transform 0.75s cubic-bezier(0.4,0,0.2,1);
}
.hm-reveal-right {
  opacity: 0;
  transform: translateX(44px);
}
.hm-reveal-right.is-visible {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.75s cubic-bezier(0.4,0,0.2,1),
              transform 0.75s cubic-bezier(0.4,0,0.2,1);
}

/* ================================================== */
/* Shared section scaffold                              */
/* ================================================== */

.hm-section {
  padding: clamp(72px, 10vw, 120px) clamp(20px, 4vw, 64px);
  max-width: 1360px;
  margin: 0 auto;
}

.hm-eyebrow {
  display: inline-block;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #75a648;
  margin-bottom: 14px;
}

.hm-title {
  font-family: 'Archivo Black', 'Space Grotesk', system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.06;
  letter-spacing: -1px;
  text-transform: uppercase;
  color: #111;
  margin: 0 0 0;
}

.hm-title span { color: #8FBF5C; }

.hm-lead {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(14px, 1.35vw, 17px);
  line-height: 1.78;
  color: #5B6158;
}

/* ================================================== */
/* S1 — WHO WE ARE                                      */
/* ================================================== */

.hm-who {
  background: #fff;
}

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

/* Image */
.hm-who__img-wrap {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  box-shadow: 0 28px 72px rgba(17,17,17,0.13);
}

.hm-who__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.06);
  transition: transform 9s ease;
}

.hm-who__img-wrap:hover .hm-who__img {
  transform: scale(1.0);
}

/* Floating badge */
.hm-who__badge {
  position: absolute;
  bottom: 24px;
  left: 24px;
  background: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 8px 28px rgba(17,17,17,0.14);
  display: flex;
  align-items: center;
  gap: 12px;
}

.hm-who__badge-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #8FBF5C;
  flex-shrink: 0;
  animation: hm-pulse 2.2s ease infinite;
}

@keyframes hm-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(143,191,92,0.65); }
  50%      { box-shadow: 0 0 0 9px rgba(143,191,92,0); }
}

.hm-who__badge-main {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
}

.hm-who__badge-sub {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 11px;
  color: #5B6158;
}

/* Content */
.hm-who__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hm-who__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hm-who__body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(14px, 1.3vw, 16px);
  line-height: 1.82;
  color: #5B6158;
  margin: 0;
}

.hm-who__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #75a648;
  text-decoration: none;
  transition: gap 0.25s ease, color 0.25s ease;
}

.hm-who__link:hover {
  gap: 14px;
  color: #1A3B2E;
}

/* Stats row */
.hm-who__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding-top: 28px;
  border-top: 1px solid #E2E5DF;
  margin-top: 4px;
}

.hm-who__stat-num {
  font-family: 'Archivo Black', system-ui, sans-serif;
  font-size: clamp(28px, 3vw, 42px);
  color: #111;
  line-height: 1;
  margin-bottom: 4px;
}

.hm-who__stat-num span { color: #8FBF5C; }

.hm-who__stat-label {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  color: #5B6158;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ================================================== */
/* S2 — WHY CHOOSE FRAMEFORGE                           */
/* ================================================== */

.hm-why {
  background: #F5F6F4;
}

.hm-why__head {
  text-align: center;
  margin-bottom: clamp(48px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.hm-why__head .hm-lead {
  max-width: 520px;
}

.hm-why__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.hm-why__card {
  background: #fff;
  border: 1px solid #E2E5DF;
  border-radius: 20px;
  padding: 34px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: default;
}

.hm-why__card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 52px rgba(17,17,17,0.1);
  border-color: #8FBF5C;
}

.hm-why__card-icon {
  width: 50px;
  height: 50px;
  border-radius: 13px;
  background: #F5F6F4;
  border: 1px solid #E2E5DF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.3s, border-color 0.3s;
}

.hm-why__card:hover .hm-why__card-icon {
  background: rgba(143,191,92,0.1);
  border-color: rgba(143,191,92,0.4);
}

.hm-why__card-icon svg {
  width: 22px;
  height: 22px;
  color: #5B6158;
  transition: color 0.3s;
}

.hm-why__card:hover .hm-why__card-icon svg {
  color: #75a648;
}

.hm-why__card-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 16.5px;
  font-weight: 700;
  color: #111;
  margin: 0;
}

.hm-why__card-desc {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.76;
  color: #5B6158;
  margin: 0;
  flex: 1;
}

/* ================================================== */
/* S3 — 6-STEP WORKFLOW (v2 — Premium)                  */
/* ================================================== */

.hm-flow {
  background: #fff;
  padding: clamp(80px, 10vw, 120px) 0;
  position: relative;
  overflow: hidden;
}

/* Blueprint grid at 2% opacity */
.hm-flow::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(72,100,44,0.02) 39px, rgba(72,100,44,0.02) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(72,100,44,0.02) 39px, rgba(72,100,44,0.02) 40px);
  pointer-events: none;
}

/* ---- Section header ---- */
.hm-flow__head {
  text-align: center;
  margin-bottom: clamp(48px, 6vw, 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hm-flow__eyebrow {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7FAE45;
  margin: 0 0 20px;
}

.hm-flow__heading {
  font-family: 'Manrope', 'Inter', system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #111;
  margin: 0 0 24px;
}

.hm-flow__heading-row { display: block; }

.hm-flow__lead {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.68;
  color: #666;
  max-width: 700px;
  margin: 0;
  text-align: center;
}

/* ---- 3-column grid ---- */
.hm-flow__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 2.5vw, 36px);
  margin-bottom: clamp(56px, 7vw, 96px);
  position: relative;
}

/* SVG connector overlay */
.hm-flow__path-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 0;
}

/* ---- Cards ---- */
.hm-flow__card {
  background: #fff;
  border: 1px solid #ECECEC;
  border-radius: 24px;
  padding: 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  z-index: 1;

  opacity: 0;
  transform: translateY(28px);

  transition:
    opacity 0.55s cubic-bezier(0.22,1,0.36,1),
    transform 0.55s cubic-bezier(0.22,1,0.36,1),
    box-shadow 0.3s ease,
    border-color 0.3s ease;

  box-shadow: 0 10px 40px rgba(0,0,0,0.05);
}

.hm-flow__card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hm-flow__card.is-visible:hover {
  transform: translateY(-10px);
  border-color: #8FBF5C;
  box-shadow: 0 24px 64px rgba(0,0,0,0.1), 0 4px 16px rgba(143,191,92,0.14);
}

/* ---- Card meta: badge + icon ---- */
.hm-flow__card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

/* Solid green badge */
.hm-flow__badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #7FAE45;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

.hm-flow__card.is-visible:hover .hm-flow__badge {
  transform: scale(1.1);
}

.hm-flow__badge span {
  font-family: 'Archivo Black', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.3px;
}

/* Icon rounded square */
.hm-flow__icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #F6FAF2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
}

.hm-flow__card.is-visible:hover .hm-flow__icon-wrap {
  transform: rotate(8deg);
}

.hm-flow__icon-wrap svg {
  width: 28px;
  height: 28px;
  color: #7FAE45;
}

/* ---- Card text ---- */
.hm-flow__card-title {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: #111;
  margin: 0 0 8px;
  letter-spacing: -0.2px;
}

.hm-flow__card-desc {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.72;
  color: #6B7569;
  margin: 0;
}

/* ---- Bottom CTA ---- */
.hm-flow__cta {
  display: flex;
  justify-content: center;
}

.hm-flow__cta-inner {
  text-align: center;
  max-width: 560px;
  padding: clamp(48px, 6vw, 72px) clamp(32px, 4vw, 64px);
  background: #F5F6F4;
  border-radius: 28px;
  border: 1px solid #E8EBE6;
}

.hm-flow__cta-title {
  font-family: 'Archivo Black', system-ui, sans-serif;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 400;
  color: #111;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin: 0 0 14px;
}

.hm-flow__cta-desc {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15.5px;
  line-height: 1.74;
  color: #5B6158;
  margin: 0 0 32px;
}

/* ================================================== */
/* S4 — OUR PROMISE                                     */
/* ================================================== */

.hm-promise {
  background: linear-gradient(135deg, #0d2318 0%, #1A3B2E 50%, #0a1810 100%);
  padding: clamp(80px, 12vw, 140px) clamp(20px, 5vw, 64px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Radial glow */
.hm-promise::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143,191,92,0.1) 0%, transparent 70%);
  pointer-events: none;
}

/* Noise texture overlay for depth */
.hm-promise::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.4;
}

.hm-promise__inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hm-promise__eyebrow {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #8FBF5C;
  margin-bottom: 16px;
}

.hm-promise__title {
  font-family: 'Archivo Black', 'Space Grotesk', system-ui, sans-serif;
  font-weight: 400;
  font-size: clamp(36px, 5.5vw, 72px);
  line-height: 1.04;
  letter-spacing: -1.5px;
  text-transform: uppercase;
  color: #fff;
  margin: 0 0 28px;
}

.hm-promise__body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(14px, 1.4vw, 17px);
  line-height: 1.82;
  color: rgba(255,255,255,0.7);
  max-width: 680px;
  margin: 0 0 56px;
}

/* Glass quote card */
.hm-promise__card {
  width: 100%;
  max-width: 680px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(143,191,92,0.22);
  border-radius: 22px;
  padding: clamp(32px,4vw,52px) clamp(24px,5vw,56px);
  backdrop-filter: blur(8px);
  position: relative;
}

/* Decorative opening quote */
.hm-promise__card::before {
  content: '\201C';
  position: absolute;
  top: -18px;
  left: 36px;
  font-family: Georgia, serif;
  font-size: 88px;
  color: #8FBF5C;
  line-height: 1;
  opacity: 0.35;
}

.hm-promise__line {
  font-family: 'Archivo Black', 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(17px, 2.4vw, 28px);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.hm-promise__line:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.hm-promise__line:first-child {
  padding-top: 0;
}

.hm-promise__line span {
  color: #8FBF5C;
}

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

@media (max-width: 1100px) {
  .hm-why__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 960px) {
  .hm-flow__heading { font-size: 54px; }

  .hm-flow__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .hm-flow__path-svg { display: none; }
}

/* Tablet: stack, use 4/3 ratio (much less cropping on a square image than 16/9) */
@media (max-width: 860px) {
  .hm-who__grid {
    grid-template-columns: 1fr;
    gap: clamp(28px, 4vw, 48px);
  }
  .hm-who__img-wrap {
    aspect-ratio: 4 / 3;
    max-height: 380px;
  }
}

/* Mobile: contain so the full product grid is always visible */
@media (max-width: 767px) {
  .hm-who__img-wrap {
    aspect-ratio: unset;
    height: 340px;
    max-height: none;
    background: #F5F6F4;
  }

  .hm-who__img {
    object-fit: contain;
    /* Kill the desktop scale animation — it would clip the contained image */
    transform: none !important;
    transition-duration: 0.01ms !important;
  }

  /* Badge: scale down and keep it from covering the products */
  .hm-who__badge {
    bottom: 14px;
    left: 14px;
    padding: 10px 13px;
    gap: 9px;
    border-radius: 11px;
  }

  .hm-who__badge-main {
    font-size: 11px;
  }

  .hm-who__badge-sub {
    font-size: 10px;
  }

  .hm-who__badge-dot {
    width: 9px;
    height: 9px;
  }
}

@media (max-width: 600px) {
  .hm-why__grid {
    grid-template-columns: 1fr;
  }

  .hm-flow__heading { font-size: 38px; }

  /* Mobile: vertical timeline layout */
  .hm-flow__grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-left: 36px;
    position: relative;
  }

  /* Vertical timeline spine */
  .hm-flow__grid::after {
    content: '';
    position: absolute;
    left: 11px;
    top: 36px;
    bottom: 36px;
    width: 2px;
    background: linear-gradient(to bottom, #7FAE45 0%, rgba(127,174,69,0.15) 100%);
    border-radius: 2px;
  }

  .hm-flow__path-svg { display: none; }

  .hm-flow__card {
    padding: 24px;
    border-radius: 20px;
    margin-bottom: 28px;
    position: relative;
  }

  .hm-flow__card:last-child { margin-bottom: 0; }

  /* Timeline connector dot */
  .hm-flow__card::before {
    content: '';
    position: absolute;
    left: -31px;
    top: 38px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #7FAE45;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px rgba(127,174,69,0.35);
  }

  .hm-flow__badge { width: 44px; height: 44px; }
  .hm-flow__badge span { font-size: 13px; }
  .hm-flow__icon-wrap { width: 44px; height: 44px; border-radius: 12px; }
  .hm-flow__icon-wrap svg { width: 24px; height: 24px; }

  .hm-promise__card { padding: 28px 20px; }
  .hm-promise__card::before { display: none; }

  .hm-who__stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hm-reveal, .hm-reveal-left, .hm-reveal-right,
  .hm-flow__card, .hm-who__badge-dot {
    transition-duration: 0.01ms !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .hm-flow__path-svg {
    display: none !important;
  }
}
