/*
 * Mr.ChatGPT homepage stability layer.
 * Purpose: isolate the custom homepage from legacy global light/dark rules.
 */

body.home #main .mc-home {
  --mc-h-bg: #f5f8fd;
  --mc-h-surface: #ffffff;
  --mc-h-surface-soft: #f1f6fd;
  --mc-h-text: #13233f;
  --mc-h-muted: #53647d;
  --mc-h-blue: #147df5;
  --mc-h-line: rgba(26, 72, 128, .13);
  --mc-h-shadow: 0 18px 50px rgba(34, 71, 119, .11);
  color: var(--mc-h-text) !important;
  background:
    radial-gradient(circle at 8% 4%, rgba(57, 147, 255, .13), transparent 28rem),
    radial-gradient(circle at 95% 30%, rgba(20, 125, 245, .08), transparent 32rem),
    var(--mc-h-bg) !important;
}

html[data-mc-theme="dark"] body.home #main .mc-home,
html:not([data-mc-theme="light"]) body.home #main .mc-home {
  --mc-h-bg: #0f192d;
  --mc-h-surface: #15233d;
  --mc-h-surface-soft: #1a2a48;
  --mc-h-text: #f3f7fd;
  --mc-h-muted: #a8b8cd;
  --mc-h-blue: #4b9dff;
  --mc-h-line: rgba(139, 190, 255, .16);
  --mc-h-shadow: 0 22px 58px rgba(0, 0, 0, .28);
  background:
    radial-gradient(circle at 8% 4%, rgba(45, 140, 255, .18), transparent 28rem),
    radial-gradient(circle at 95% 30%, rgba(74, 137, 255, .11), transparent 32rem),
    var(--mc-h-bg) !important;
}

/* Reset legacy global color rules on the custom homepage. */
body.home #main .mc-home :is(h1, h2, h3, h4, h5, h6, strong, b) {
  color: var(--mc-h-text) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body.home #main .mc-home :is(p, li, small, label) {
  color: var(--mc-h-muted) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

body.home #main .mc-home .mc-home-kicker,
body.home #main .mc-home .mc-home-section__head > a,
body.home #main .mc-home .mc-home-course-card__link,
body.home #main .mc-home .mc-home-article-card__more,
body.home #main .mc-home .mc-home-path-grid article:not(.is-featured) > a,
body.home #main .mc-home .mc-home-article-card__meta {
  color: var(--mc-h-blue) !important;
  opacity: 1 !important;
}

body.home #main .mc-home .mc-home-hero__copy > p,
body.home #main .mc-home .mc-home-section__head--center p,
body.home #main .mc-home .mc-home-value p,
body.home #main .mc-home .mc-home-course-card__body > p,
body.home #main .mc-home .mc-home-path-grid article:not(.is-featured) p,
body.home #main .mc-home .mc-home-article-card p,
body.home #main .mc-home .mc-home-visual__core > span,
body.home #main .mc-home .mc-home-hero__trust span {
  color: var(--mc-h-muted) !important;
  opacity: 1 !important;
}

body.home #main .mc-home .mc-home-orbit span,
body.home #main .mc-home .mc-home-visual__mini span {
  color: var(--mc-h-text) !important;
  opacity: 1 !important;
}

/* Buttons must not inherit the legacy global link color. */
body.home #main .mc-home a.mc-home-btn--primary,
body.home #main .mc-home a.mc-home-btn--primary span {
  color: #ffffff !important;
  opacity: 1 !important;
}

body.home #main .mc-home a.mc-home-btn--ghost,
body.home #main .mc-home a.mc-home-btn--ghost span {
  color: var(--mc-h-text) !important;
  opacity: 1 !important;
}

/* Hero */
body.home #main .mc-home .mc-home-hero__copy h1 {
  color: var(--mc-h-text) !important;
  opacity: 1 !important;
}

body.home #main .mc-home .mc-home-visual__core,
body.home #main .mc-home .mc-home-value article,
body.home #main .mc-home .mc-home-course-card,
body.home #main .mc-home .mc-home-path-grid article:not(.is-featured),
body.home #main .mc-home .mc-home-article-card {
  color: var(--mc-h-text) !important;
  background: var(--mc-h-surface) !important;
  border-color: var(--mc-h-line) !important;
  box-shadow: var(--mc-h-shadow) !important;
}

body.home #main .mc-home .mc-home-visual__core {
  background: linear-gradient(155deg, var(--mc-h-surface), var(--mc-h-surface-soft)) !important;
}

body.home #main .mc-home .mc-home-orbit span,
body.home #main .mc-home .mc-home-visual__mini,
body.home #main .mc-home .mc-home-btn--ghost {
  background: color-mix(in srgb, var(--mc-h-surface) 90%, transparent) !important;
  border-color: var(--mc-h-line) !important;
}

/* Course and article cards */
body.home #main .mc-home .mc-home-course-card h3 a,
body.home #main .mc-home .mc-home-article-card h3 a {
  color: var(--mc-h-text) !important;
  opacity: 1 !important;
}

body.home #main .mc-home .mc-home-course-card__price,
body.home #main .mc-home .mc-home-course-card__price :is(span, bdi) {
  color: var(--mc-h-text) !important;
  opacity: 1 !important;
}

body.home #main .mc-home .mc-home-course-card__price ins,
body.home #main .mc-home .mc-home-course-card__price ins :is(span, bdi) {
  color: var(--mc-h-blue) !important;
  opacity: 1 !important;
}

body.home #main .mc-home .mc-home-course-card__price del,
body.home #main .mc-home .mc-home-course-card__price del :is(span, bdi) {
  color: var(--mc-h-muted) !important;
  opacity: .7 !important;
}

body.home #main .mc-home .mc-home-course-card__tag {
  color: #ffffff !important;
  opacity: 1 !important;
  background: rgba(7, 23, 46, .82) !important;
}

/* Featured path card */
body.home #main .mc-home .mc-home-path-grid article.is-featured {
  color: #ffffff !important;
  background: linear-gradient(145deg, #258df7, #0759b8) !important;
  border-color: transparent !important;
  box-shadow: 0 24px 58px rgba(15, 103, 207, .28) !important;
}

body.home #main .mc-home .mc-home-path-grid article.is-featured :is(h3, p, a, span) {
  color: #ffffff !important;
  opacity: 1 !important;
}

body.home #main .mc-home .mc-home-path-grid article.is-featured p {
  color: rgba(255, 255, 255, .84) !important;
}

body.home #main .mc-home .mc-home-path-grid__number {
  color: color-mix(in srgb, var(--mc-h-blue) 15%, transparent) !important;
  opacity: 1 !important;
}

body.home #main .mc-home .mc-home-path-grid article.is-featured .mc-home-path-grid__number {
  color: rgba(255, 255, 255, .15) !important;
}

/* Blue CTA card */
body.home #main .mc-home .mc-home-cta__card :is(h2, h3, strong) {
  color: #ffffff !important;
  opacity: 1 !important;
}

body.home #main .mc-home .mc-home-cta__card p {
  color: rgba(255, 255, 255, .82) !important;
  opacity: 1 !important;
}

body.home #main .mc-home .mc-home-cta__card .mc-home-kicker {
  color: #d9ebff !important;
}

body.home #main .mc-home .mc-home-cta__card a.mc-home-btn--primary {
  color: #0b62c2 !important;
  background: #ffffff !important;
}

body.home #main .mc-home .mc-home-cta__card a.mc-home-btn--ghost {
  color: #ffffff !important;
  background: rgba(255, 255, 255, .09) !important;
  border-color: rgba(255, 255, 255, .35) !important;
}

/* Prevent accidental hidden/faded content from legacy animation utilities. */
body.home #main .mc-home :is(
  .mc-home-hero__copy,
  .mc-home-section__head,
  .mc-home-value article,
  .mc-home-course-card,
  .mc-home-path-grid article,
  .mc-home-article-card,
  .mc-home-cta__card
) {
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
}

/* Floating Telegram button: smaller and clear of content. */
body #qltgm.qltgm-bottom-left {
  left: 14px !important;
  right: auto !important;
  bottom: 14px !important;
  z-index: 9997 !important;
}

body #qltgm .qltgm-toggle {
  width: 50px !important;
  min-width: 50px !important;
  height: 50px !important;
  min-height: 50px !important;
  border-radius: 50% !important;
  box-shadow: 0 13px 31px rgba(20, 135, 199, .26) !important;
}

body #qltgm .qltgm-icon {
  font-size: 25px !important;
}

/* Mobile density and rhythm */
@media (max-width: 620px) {
  body.home #main .mc-home .mc-home-shell {
    width: calc(100% - 28px) !important;
  }

  body.home #main .mc-home .mc-home-hero {
    padding: 30px 0 24px !important;
  }

  body.home #main .mc-home .mc-home-hero__grid {
    gap: 16px !important;
  }

  body.home #main .mc-home .mc-home-hero__copy h1 {
    margin: 12px auto 14px !important;
    font-size: clamp(32px, 9vw, 40px) !important;
    line-height: 1.42 !important;
  }

  body.home #main .mc-home .mc-home-hero__copy > p {
    font-size: 14px !important;
    line-height: 1.95 !important;
  }

  body.home #main .mc-home .mc-home-actions {
    margin-top: 20px !important;
    gap: 10px !important;
  }

  body.home #main .mc-home .mc-home-hero__trust {
    margin-top: 18px !important;
    gap: 10px !important;
  }

  body.home #main .mc-home .mc-home-visual {
    min-height: 350px !important;
    margin: -8px auto -10px !important;
    transform: none !important;
  }

  body.home #main .mc-home .mc-home-value {
    padding: 6px 0 44px !important;
  }

  body.home #main .mc-home .mc-home-value article {
    min-height: 0 !important;
    padding: 18px !important;
  }

  body.home #main .mc-home .mc-home-section {
    padding: 48px 0 !important;
  }

  body.home #main .mc-home .mc-home-section__head {
    margin-bottom: 22px !important;
  }

  body.home #main .mc-home .mc-home-section__head h2 {
    margin-top: 8px !important;
    font-size: 28px !important;
    line-height: 1.55 !important;
  }

  body.home #main .mc-home .mc-home-course-grid,
  body.home #main .mc-home .mc-home-article-grid,
  body.home #main .mc-home .mc-home-path-grid {
    gap: 16px !important;
  }

  body.home #main .mc-home .mc-home-course-card,
  body.home #main .mc-home .mc-home-article-card,
  body.home #main .mc-home .mc-home-path-grid article {
    min-height: 0 !important;
    height: auto !important;
    border-radius: 22px !important;
  }

  body.home #main .mc-home .mc-home-path-grid article {
    padding: 23px !important;
  }

  body.home #main .mc-home .mc-home-path-grid p,
  body.home #main .mc-home .mc-home-course-card__body > p,
  body.home #main .mc-home .mc-home-article-card p {
    min-height: 0 !important;
    margin-bottom: 16px !important;
  }

  body.home #main .mc-home .mc-home-path-grid__number {
    font-size: 62px !important;
  }

  body.home #main .mc-home .mc-home-cta {
    padding: 48px 0 64px !important;
  }

  body.home #main .mc-home .mc-home-cta__card {
    min-height: 0 !important;
    padding: 28px 20px !important;
    border-radius: 24px !important;
  }

  body.home #main .mc-home .mc-home-cta__card h2 {
    font-size: 27px !important;
    line-height: 1.65 !important;
  }

  body #qltgm.qltgm-bottom-left {
    left: 10px !important;
    bottom: 10px !important;
  }

  body #qltgm .qltgm-toggle {
    width: 46px !important;
    min-width: 46px !important;
    height: 46px !important;
    min-height: 46px !important;
  }
}

/* Final button contrast hotfix — only the two reported buttons. */
body.home #main .mc-home .mc-home-hero .mc-home-actions > a.mc-home-btn--primary {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  text-shadow: none !important;
}

body.home #main .mc-home .mc-home-hero .mc-home-actions > a.mc-home-btn--primary :is(span, svg, path) {
  color: #ffffff !important;
  stroke: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}

body.home #main .mc-home .mc-home-cta .mc-home-actions > a.mc-home-btn--ghost {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: rgba(255, 255, 255, .12) !important;
  border-color: rgba(255, 255, 255, .48) !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  text-shadow: none !important;
}

body.home #main .mc-home .mc-home-cta .mc-home-actions > a.mc-home-btn--ghost :is(span, svg, path) {
  color: #ffffff !important;
  stroke: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}
