/*
 * ACTIVE homepage cohesion pass.
 *
 * This file is deliberately scoped to #active. It applies the locked shared
 * homepage hero geometry and warm-stone foundation, then gives the existing
 * Active card groups the same manufactured cream surround. Card contents,
 * dimensions, order, artwork and route behaviour remain owned by the existing
 * Active styles and controller.
 */

#active.page {
  --rebuild-home-hero-gutter: 15px;
  --rebuild-home-hero-top-gap: 33px;
  --rebuild-home-hero-bottom-gap: 26px;
  --rebuild-home-hero-height: 300px;
  --rebuild-home-hero-radius: 26px;
  --rebuild-home-hero-border: rgba(91, 73, 55, 0.48);
  --rebuild-home-hero-inner-line: rgba(49, 41, 33, 0.28);
  --rebuild-home-hero-rim: #f4eadf;
  --rebuild-home-hero-highlight: #fffdf9;
  --rebuild-home-hero-bevel: #d7c7b5;
  --rebuild-home-hero-shadow-tight: rgba(57, 51, 45, 0.25);
  --rebuild-home-hero-shadow-broad: rgba(57, 51, 45, 0.18);
  --rebuild-home-foundation: #e5dad1;
  --rebuild-home-foundation-light: #eee6de;
  --rebuild-home-foundation-mid: #e8ddd3;
  --rebuild-home-foundation-deep: #ddd0c5;
  --active-home-frame-surface: #eee2d4;
  --active-home-frame-highlight: #fffaf4;
  --active-home-frame-bevel: #d6c4b3;
  --active-home-frame-shadow-tight: rgba(59, 48, 40, 0.22);
  --active-home-frame-shadow-broad: rgba(50, 42, 35, 0.15);
  background-color: var(--rebuild-home-foundation) !important;
  background-image:
    radial-gradient(at 14% 7%, rgba(255, 255, 255, 0.46) 0, rgba(255, 255, 255, 0.16) 28%, transparent 52%),
    radial-gradient(at 86% 31%, rgba(151, 128, 110, 0.12) 0, transparent 38%),
    repeating-radial-gradient(circle at 25% 35%, rgba(77, 62, 51, 0.02) 0 0.7px, transparent 0.9px 5px),
    linear-gradient(164deg, var(--rebuild-home-foundation-light) 0%, var(--rebuild-home-foundation-mid) 47%, var(--rebuild-home-foundation-deep) 100%) !important;
}

html body main.app:has(> #active.page.on) {
  background: var(--rebuild-home-foundation) !important;
}

#active .active-approved-home.active-kinetic-home {
  padding-top: var(--rebuild-home-hero-top-gap) !important;
  background: transparent !important;
}

/* TODAY structure + MENTAL text composition, expressed with Active's mint. */
html body main.app > #active.page .active-kinetic-home > .active-approved-top {
  position: relative !important;
  isolation: isolate !important;
  left: 50% !important;
  display: block !important;
  box-sizing: border-box !important;
  width: min(calc(100vw - (var(--rebuild-home-hero-gutter) * 2)), 760px) !important;
  height: var(--rebuild-home-hero-height) !important;
  min-height: var(--rebuild-home-hero-height) !important;
  margin: 0 0 var(--rebuild-home-hero-bottom-gap) !important;
  padding: 0 !important;
  overflow: hidden !important;
  transform: translateX(-50%) !important;
  border: 1px solid var(--rebuild-home-hero-border) !important;
  border-radius: var(--rebuild-home-hero-radius) !important;
  background: #e8ded2 !important;
  box-shadow:
    inset 0 0 0 1px var(--rebuild-home-hero-inner-line),
    0 0 0 6px var(--rebuild-home-hero-rim),
    -2px -2px 0 8px var(--rebuild-home-hero-highlight),
    2px 2px 0 8px var(--rebuild-home-hero-bevel),
    0 7px 6px 8px var(--rebuild-home-hero-shadow-tight),
    0 20px 34px 9px var(--rebuild-home-hero-shadow-broad) !important;
}

#active .active-kinetic-home .active-approved-top::before {
  content: "" !important;
  position: absolute !important;
  inset: 4px !important;
  z-index: 3 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  border: 1px solid rgba(89, 242, 154, 0.62) !important;
  border-radius: 21px !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

#active .active-kinetic-home .active-approved-top::after {
  content: "" !important;
  position: absolute !important;
  inset: 4px !important;
  z-index: 1 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  border-radius: 21px !important;
  background:
    radial-gradient(
      ellipse 68% 76% at 5% 38%,
      rgba(243, 242, 238, 0.72) 0%,
      rgba(243, 242, 238, 0.56) 38%,
      rgba(243, 242, 238, 0.18) 72%,
      transparent 100%
    ),
    radial-gradient(
      ellipse 64% 26% at 7% 86%,
      rgba(243, 242, 238, 0.6) 0%,
      rgba(243, 242, 238, 0.3) 58%,
      transparent 100%
    ),
    linear-gradient(
      90deg,
      rgba(243, 242, 238, 0.24) 0%,
      rgba(243, 242, 238, 0.1) 27%,
      transparent 48%
    ) !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

#active .active-approved-top > .active-hero-artwork {
  position: absolute !important;
  inset: 4px !important;
  z-index: 0 !important;
  display: block !important;
  overflow: hidden !important;
  border-radius: 21px !important;
  pointer-events: none !important;
}

#active .active-approved-top > .active-hero-artwork > img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: 50% 50% !important;
  filter: contrast(1.04) saturate(1.08) !important;
  pointer-events: none !important;
  user-select: none !important;
}

#active .active-kinetic-home .active-approved-top > div {
  position: absolute !important;
  inset: 22px auto 22px 22px !important;
  z-index: 2 !important;
  display: flex !important;
  width: min(56%, 285px) !important;
  min-width: 0 !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  color: #172520 !important;
  text-shadow: none !important;
}

#active .active-kinetic-home .active-hero-kicker {
  display: block !important;
  margin: 0 0 10px !important;
  color: #217052 !important;
  font: 950 13px/1 Arial, Helvetica, sans-serif !important;
  letter-spacing: 0.14em !important;
  text-shadow: none !important;
}

#active .active-kinetic-home .active-approved-top h1 {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  color: #172520 !important;
  font: 950 clamp(28px, 7.4vw, 37px)/0.91 Arial, Helvetica, sans-serif !important;
  letter-spacing: -0.045em !important;
  text-wrap: balance !important;
  text-shadow: none !important;
}

#active .active-kinetic-home .active-approved-top p {
  width: 100% !important;
  max-width: none !important;
  margin: auto 0 0 !important;
  color: #f5f0e7 !important;
  font: 850 13.5px/1.27 Arial, Helvetica, sans-serif !important;
  letter-spacing: -0.01em !important;
  text-shadow:
    0 1px 2px rgba(5, 11, 9, 0.96),
    0 2px 8px rgba(5, 11, 9, 0.78) !important;
}

/* Existing boxes retain their exact inner geometry and receive one shared rim. */
#active .active-kinetic-home .active-start-card.active-kinetic-hero {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 0 0 2px var(--active-home-frame-surface),
    -1px -1px 0 4px var(--active-home-frame-highlight),
    1px 2px 0 4px var(--active-home-frame-bevel),
    0 7px 7px 4px var(--active-home-frame-shadow-tight),
    0 14px 22px 5px var(--active-home-frame-shadow-broad) !important;
}

#active .active-kinetic-home .active-start-card.active-kinetic-hero::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  border-radius: inherit !important;
  background: linear-gradient(
    90deg,
    rgba(243, 242, 238, 0.96) 0%,
    rgba(243, 242, 238, 0.90) 34%,
    rgba(243, 242, 238, 0.72) 48%,
    rgba(243, 242, 238, 0.28) 58%,
    rgba(243, 242, 238, 0.04) 70%,
    transparent 78%
  ) !important;
  pointer-events: none !important;
}

#active .active-kinetic-home .active-kinetic-hero-plate img {
  object-position: 50% 50% !important;
  filter: contrast(1.04) saturate(1.08) !important;
}

@media (max-width: 430px) {
  #active .active-kinetic-hero .active-start-copy {
    top: 57px !important;
    width: 47% !important;
    max-width: 170px !important;
  }

  #active .active-kinetic-hero .active-start-copy > small {
    display: block !important;
    margin: 0 0 6px !important;
    font-size: 8px !important;
    line-height: 1.22 !important;
    letter-spacing: 0.1em !important;
    text-wrap: balance !important;
  }

  #active .active-kinetic-hero .active-start-copy > b {
    display: block !important;
    width: 112px !important;
    font-size: 18px !important;
    line-height: 1 !important;
  }

  #active .active-kinetic-hero .active-start-copy > span {
    display: block !important;
    width: 100% !important;
    max-width: 162px !important;
    margin-top: 8px !important;
    font-size: 10.5px !important;
    line-height: 1.25 !important;
    font-weight: 750 !important;
    text-wrap: balance !important;
  }
}

#active .active-kinetic-home .active-approved-grid.active-movement-deck {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 0 0 2px var(--active-home-frame-surface),
    -1px -1px 0 4px var(--active-home-frame-highlight),
    1px 2px 0 4px var(--active-home-frame-bevel),
    0 7px 7px 4px var(--active-home-frame-shadow-tight),
    0 14px 22px 5px var(--active-home-frame-shadow-broad) !important;
}

#active .active-kinetic-home .active-move-recover-deck > .active-approved-card {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    inset 0 -2px 0 rgba(107, 93, 73, 0.12),
    0 0 0 2px var(--active-home-frame-surface),
    -1px -1px 0 4px var(--active-home-frame-highlight),
    1px 2px 0 4px var(--active-home-frame-bevel),
    0 7px 7px 4px var(--active-home-frame-shadow-tight),
    0 14px 22px 5px var(--active-home-frame-shadow-broad) !important;
}

#active .active-kinetic-home .active-approved-card.progress.active-kinetic-progress {
  box-shadow:
    inset 0 0 0 1px rgba(89, 242, 154, 0.56),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -8px 16px rgba(0, 0, 0, 0.23),
    0 0 0 2px var(--active-home-frame-surface),
    -1px -1px 0 4px var(--active-home-frame-highlight),
    1px 2px 0 4px var(--active-home-frame-bevel),
    0 7px 7px 4px var(--active-home-frame-shadow-tight),
    0 14px 22px 5px var(--active-home-frame-shadow-broad) !important;
}

@media (max-width: 390px) {
  #active.page {
    --rebuild-home-hero-height: 292px;
  }
}

@media (max-width: 360px) {
  #active.page {
    --rebuild-home-hero-gutter: 12px;
    --rebuild-home-hero-top-gap: 30px;
    --rebuild-home-hero-bottom-gap: 24px;
    --rebuild-home-hero-height: 282px;
  }

  html body main.app > #active.page .active-kinetic-home > .active-approved-top {
    box-shadow:
      inset 0 0 0 1px var(--rebuild-home-hero-inner-line),
      0 0 0 5px var(--rebuild-home-hero-rim),
      -2px -2px 0 7px var(--rebuild-home-hero-highlight),
      2px 2px 0 7px var(--rebuild-home-hero-bevel),
      0 7px 6px 7px var(--rebuild-home-hero-shadow-tight),
      0 18px 30px 8px var(--rebuild-home-hero-shadow-broad) !important;
  }

  #active .active-kinetic-home .active-approved-top > div {
    inset: 19px auto 19px 19px !important;
    width: 58% !important;
  }

  #active .active-kinetic-home .active-approved-top h1 {
    font-size: 28px !important;
  }

  #active .active-kinetic-home .active-approved-top p {
    font-size: 13px !important;
  }

  #active .active-kinetic-hero .active-start-copy {
    width: 48% !important;
    max-width: 150px !important;
  }

  #active .active-kinetic-hero .active-start-copy > b {
    width: 108px !important;
    font-size: 17px !important;
  }

  #active .active-kinetic-hero .active-start-copy > span {
    max-width: 145px !important;
    font-size: 10px !important;
  }
}

@media (min-width: 800px) {
  #active.page {
    --rebuild-home-hero-gutter: 50px;
    --rebuild-home-hero-top-gap: 36px;
    --rebuild-home-hero-bottom-gap: 30px;
    --rebuild-home-hero-height: 360px;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  #active.page {
    --rebuild-home-hero-top-gap: 18px;
    --rebuild-home-hero-bottom-gap: 18px;
    --rebuild-home-hero-height: 220px;
  }

  #active .active-kinetic-home .active-approved-top > div {
    inset-block: 16px !important;
  }
}

@media (forced-colors: active) {
  html body main.app > #active.page .active-kinetic-home > .active-approved-top,
  #active .active-kinetic-home .active-start-card.active-kinetic-hero,
  #active .active-kinetic-home .active-approved-grid.active-movement-deck,
  #active .active-kinetic-home .active-move-recover-deck > .active-approved-card,
  #active .active-kinetic-home .active-approved-card.progress.active-kinetic-progress {
    border-color: CanvasText !important;
    box-shadow: none !important;
  }

  #active .active-kinetic-home .active-approved-top::before {
    border-color: Highlight !important;
  }
}
