/* v6.4: plan-card hover (desktop/tablet), CTA inset card, Ivy phone should-fixes.
   Does not rewrite v6-life.css glow rules. Desktop rest state of other sections is unchanged. */

/* ----- 1. Plan cards: 2px lift + calm hover glow (min-width 601; phone hovers stay off) ----- */
@media (min-width: 601px) {
  #plans .mp-plan {
    isolation: isolate;
    /* Color/shadow transitions only; motion is gated below. */
    transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
  }
  #plans .mp-plan::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: -1;
    contain: paint;
    opacity: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(101, 88, 232, 0.22) 0%, rgba(101, 88, 232, 0) 70%);
    /* Static gradient; no filter, no animation, no blur. */
  }
  #plans .mp-plan:hover::before,
  #plans .mp-plan:focus-within::before {
    opacity: 1;
  }
  /* Same calm purple border/glow language as doors; popular highlight (badge, 1.5px #6558E8 border, colors) stays. */
  #plans .mp-plan:hover,
  #plans .mp-plan:focus-within {
    border-color: #6558E8;
    box-shadow: 0 8px 22px rgba(101, 88, 232, 0.16), 0 0 0 1px rgba(101, 88, 232, 0.22);
  }
  html.dark #plans .mp-plan:hover,
  html.dark #plans .mp-plan:focus-within {
    border-color: #8f85ff;
    box-shadow: 0 8px 22px rgba(101, 88, 232, 0.32), 0 0 0 1px rgba(143, 133, 255, 0.4);
  }
  html.dark #plans .mp-plan:hover::before,
  html.dark #plans .mp-plan:focus-within::before {
    background: radial-gradient(ellipse at 50% 0%, rgba(143, 133, 255, 0.28) 0%, rgba(143, 133, 255, 0) 70%);
  }

  /* Enterprise: keep the dark card and existing gradient border; hover glow is neutral, no added purple. */
  #plans .mp-plan-enterprise:hover,
  #plans .mp-plan-enterprise:focus-within,
  html.dark #plans .mp-plan-enterprise:hover,
  html.dark #plans .mp-plan-enterprise:focus-within {
    border-color: transparent;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.14);
  }
  #plans .mp-plan-enterprise:hover::before,
  #plans .mp-plan-enterprise:focus-within::before,
  html.dark #plans .mp-plan-enterprise:hover::before,
  html.dark #plans .mp-plan-enterprise:focus-within::before {
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 70%);
  }

  @media (prefers-reduced-motion: no-preference) {
    #plans .mp-plan {
      transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease;
    }
    #plans .mp-plan:hover,
    #plans .mp-plan:focus-within,
    #plans .mp-plan.reveal.is-in:hover,
    #plans .mp-plan.reveal.is-in:focus-within,
    #plans .mp-plan.reveal.in:hover,
    #plans .mp-plan.reveal.in:focus-within,
    html.m2 #plans .mp-plan:hover,
    html.m2 #plans .mp-plan:focus-within,
    html.m2 #plans .mp-plan.reveal.is-in:hover,
    html.m2 #plans .mp-plan.reveal.in:hover {
      transform: translateY(-2px) !important;
    }
    /* Popular rest lift is flattened to none after reveal (html.m2 .reveal !important); use the same 2px hover lift. */
    @media (min-width: 1101px) {
      #plans .mp-plan-popular:hover,
      #plans .mp-plan-popular:focus-within,
      #plans .mp-plan-popular.reveal.is-in:hover,
      #plans .mp-plan-popular.reveal.is-in:focus-within,
      #plans .mp-plan-popular.reveal.in:hover,
      html.m2 #plans .mp-plan-popular:hover,
      html.m2 #plans .mp-plan-popular.reveal.is-in:hover,
      html.m2 #plans .mp-plan-popular.reveal.in:hover {
        transform: translateY(-2px) !important;
      }
    }
  }

  @media (prefers-reduced-motion: reduce) {
    #plans .mp-plan:hover,
    #plans .mp-plan:focus-within,
    #plans .mp-plan.reveal.is-in:hover,
    #plans .mp-plan-popular:hover,
    #plans .mp-plan-popular.reveal.is-in:hover {
      transform: none;
    }
    /* Re-apply the existing reduced-motion flattening of the popular rest lift. */
    #plans .mp-plan-popular {
      transform: none;
    }
  }
}

/* ----- 2. CTA: rounded inset card, same colors, page background visible around it ----- */
section.cta-band {
  box-sizing: border-box;
  width: calc(100% - 80px);
  max-width: 1260px;
  margin-top: 40px;
  margin-bottom: 40px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 24px;
  overflow: hidden;
  /* Background color stays the existing band color (#20212a / dark #13141c; phone overrides remain). */
}
/* Page bg around the card is body (#fff / dark #0f1016), not a new band. */
html.dark section.cta-band {
  /* keep existing dark band color; do not extend it to the margins */
  background: #13141c;
}

@media (max-width: 600px) {
  section.cta-band {
    width: auto;
    max-width: none;
    margin: 16px;
    border-radius: 20px;
  }

  /* Ivy should-fix: plan name + price stay on one row at 320–390 */
  #plans .mp-plan h3 {
    font-size: 18px !important;
    flex: 1 1 0;
    min-width: 0;
  }
  #plans .mp-slot {
    font-size: 14px !important;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Ivy should-fix: Foundation "See all" sits above the revealed items (like FAQ), so it does not jump. */
  .hubviz .hub {
    display: flex;
    flex-direction: column;
  }
  .hubviz .hub .hub-k,
  .hubviz .hub h3 {
    order: 0;
  }
  .hubviz .hub ul {
    display: contents;
  }
  .hubviz .hub ul li:nth-child(-n+3) {
    order: 1;
  }
  .hubviz .hub .hub-more-btn {
    order: 2;
  }
  .hubviz .hub ul li:nth-child(n+4) {
    order: 3;
  }
}


/* ----- 3. Wordmark “TECHNOLOGIES”: 12px on desktop (was ~5–6px); phone stays 12px ----- */
.wordmark small,
.wordtext small,
.header .wordmark small,
header .wordmark small,
.footer .wordmark small {
  font-size: 12px !important;
  letter-spacing: 0.16em;
  margin-top: 4px;
}

/* ----- 4. Fork “If nothing changes”: red dashes/heading → slate (AA); dark → brand violet ----- */
/* Light #5e5a6b on #f6f4f4 is 6.08:1. Dark #c4beff on #171825 is 10.18:1. */
.fork-a h3,
.fork-a li::before,
.fork-a li:before {
  color: #5e5a6b !important;
}
html.dark .fork-a h3,
html.dark .fork-a li::before,
html.dark .fork-a li:before {
  color: #c4beff !important;
}

@media (max-width: 600px) {
  .wordmark small,
  .wordtext small,
  .header .wordmark small,
  header .wordmark small,
  .footer .wordmark small {
    letter-spacing: 0.08em;
    margin-top: 2px;
  }

  /* Longer header CTA: 48px tap, clean wrap if needed, no overflow at 320–430 */
  .header .button.small {
    min-height: 48px !important;
    height: auto !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
    max-width: 11.5rem;
  }
  .header .button.small .lbl-short,
  .header .button.small .lbl-long {
    white-space: normal;
    text-align: center;
  }
  .header .wordmark {
    min-width: 0;
    flex: 0 1 auto;
  }
  .header .wordmark .wordtext {
    font-size: 26px;
  }
}

@media (max-width: 360px) {
  .header {
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 6px;
  }
  .header .button.small {
    padding: 6px 8px !important;
    max-width: 9.6rem;
    font-size: 11px !important;
  }
  .header .wordmark .wordtext {
    font-size: 24px;
  }
}

/* Green metric text in leftover m2 UI → slate / brand violet (AA) */
.m2-ar b { color: #5e5a6b !important; }
html.dark .m2-ar b { color: #c4beff !important; }

@media (max-width: 600px) {
  /* Keep the longer main CTA on one line in full-width bands */
  .fork-cta .button.cta-main,
  .talk-row .button.cta-main,
  section.cta-band .button.cta-main,
  a.rh-btn,
  #plans .mp-btn {
    padding-left: 16px !important;
    padding-right: 16px !important;
    white-space: nowrap;
  }
}
