/* ==========================================================================
   MHM Center — Modern landing layer
   Load AFTER /assets/styles.css. Every rule is scoped under html.mhm-modern,
   which mhm-modern.js only adds on the landing page (has .hero + #modul),
   so other pages (modul, checkout, login) are untouched.
   ========================================================================== */

.mhm-modern {
  --m-navy: #0b1424;
  --m-teal: #0aa59b;
  --m-teal-deep: #087f78;
  --m-mint: #70e7c4;
  --m-violet: #7357ff;
  --m-gold: #e9b35c;
  --m-ink: #13203a;
  --m-muted: #5f6b80;
  --m-card: rgba(255, 255, 255, 0.78);
  --m-ring: rgba(10, 165, 155, 0.35);
  --m-radius: 22px;
  --m-ease: cubic-bezier(0.22, 1, 0.36, 1);
  scroll-behavior: smooth;
}

.mhm-modern body {
  background: #f6f8fb;
}

/* ---------- Scroll progress ---------- */
.mhm-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 3px;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--m-teal), var(--m-violet), var(--m-gold));
}

/* ---------- Header: sticky glass ---------- */
.mhm-modern .site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(246, 248, 251, 0.72);
  border-bottom-color: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, min-height 0.3s ease;
}

.mhm-modern .site-header.is-scrolled {
  min-height: 62px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 30px rgba(11, 20, 36, 0.08);
  border-bottom-color: rgba(11, 20, 36, 0.06);
}

.mhm-modern .site-header nav a {
  position: relative;
  transition: color 0.2s ease, background 0.2s ease;
}

.mhm-modern .site-header nav a[href="/login"] {
  margin-left: 6px;
  color: #fff;
  background: var(--m-navy);
}

.mhm-modern .site-header nav a[href="/login"]:hover {
  background: var(--m-teal-deep);
}

/* ---------- Hero ---------- */
.mhm-modern .hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: min(820px, calc(100vh - 72px));
  background: #f6f8fb;
}

.mhm-modern .hero::before,
.mhm-modern .hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  animation: mhm-drift 18s var(--m-ease) infinite alternate;
}

.mhm-modern .hero::before {
  width: 560px;
  height: 560px;
  top: -180px;
  right: -120px;
  background: radial-gradient(circle, #8ff0d3, transparent 65%);
}

.mhm-modern .hero::after {
  width: 520px;
  height: 520px;
  bottom: -220px;
  left: -160px;
  background: radial-gradient(circle, #c9bdff, transparent 65%);
  animation-delay: -9s;
}

.mhm-hero-grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(11, 20, 36, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 20, 36, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 30% 40%, #000 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 10%, transparent 70%);
}

.mhm-modern .hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid rgba(10, 165, 155, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--m-teal-deep);
  font-size: 12px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

.mhm-modern .hero .eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #20d09a;
  box-shadow: 0 0 0 0 rgba(32, 208, 154, 0.6);
  animation: mhm-pulse 2s infinite;
}

.mhm-modern .hero h1 {
  margin-top: 8px;
  color: var(--m-navy);
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.mhm-modern .hero h1 .mhm-gradient {
  background: linear-gradient(100deg, var(--m-teal) 0%, var(--m-violet) 55%, var(--m-teal) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: mhm-shine 6s linear infinite;
}

.mhm-modern .hero .lead {
  color: var(--m-muted);
}

.mhm-modern .hero-actions .button {
  min-height: 54px;
  padding: 0 24px;
  border-radius: 14px;
}

/* Rotating typed skill line */
.mhm-typer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 22px 0 0;
  color: var(--m-ink);
  font-size: 15px;
  font-weight: 800;
}

.mhm-typer b {
  min-width: 1ch;
  padding: 6px 12px;
  border-radius: 10px;
  color: #fff;
  background: var(--m-navy);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
}

.mhm-typer b::after {
  content: "▍";
  margin-left: 2px;
  color: var(--m-mint);
  animation: mhm-blink 1s steps(1) infinite;
}

/* Trust chips */
.mhm-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.mhm-trust li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid rgba(11, 20, 36, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.75);
  color: #3c4a62;
  font-size: 13px;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.mhm-trust li::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #dcfaf0;
  color: var(--m-teal-deep);
  font-size: 11px;
  font-weight: 950;
}

/* Hero product stack: 3D tilt + float */
.mhm-modern .hero-product {
  perspective: 1200px;
}

.mhm-modern .product-stack {
  border-radius: 28px;
  box-shadow: 0 40px 90px rgba(11, 20, 36, 0.22);
  transform-style: preserve-3d;
  transition: transform 0.5s var(--m-ease);
  will-change: transform;
}

.mhm-modern .product-stack .floating {
  animation: mhm-float 6s ease-in-out infinite;
  backdrop-filter: blur(10px);
}

.mhm-modern .product-stack .report-mini {
  animation-delay: -3s;
}

.mhm-modern .product-stack .main-product {
  box-shadow: 0 20px 50px rgba(11, 20, 36, 0.25);
}

/* ---------- Buttons ---------- */
.mhm-modern .button {
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--m-ease), box-shadow 0.25s ease, background 0.25s ease;
}

.mhm-modern .button.primary {
  border: 0;
  background: linear-gradient(135deg, var(--m-teal), var(--m-teal-deep));
  box-shadow: 0 14px 34px rgba(8, 127, 120, 0.32);
}

.mhm-modern .button.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.7s var(--m-ease);
}

.mhm-modern .button.primary:hover::after {
  transform: translateX(120%);
}

.mhm-modern .button:not(.disabled):not([aria-disabled="true"]):hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(11, 20, 36, 0.16);
}

.mhm-modern .button.ghost {
  border-color: rgba(11, 20, 36, 0.1);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
}

/* ---------- Stats strip ---------- */
.mhm-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--mhm-cols, 4), minmax(0, 1fr));
  gap: 1px;
  max-width: 1120px;
  margin: -46px auto 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--m-radius);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 70px rgba(11, 20, 36, 0.25);
}

.mhm-stats div {
  padding: 24px 22px;
  background: var(--m-navy);
  color: #fff;
}

.mhm-stats strong {
  display: block;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #fff, var(--m-mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mhm-stats span {
  display: block;
  margin-top: 8px;
  color: #9aa7bd;
  font-size: 13px;
  font-weight: 700;
}

/* ---------- Section headings ---------- */
.mhm-modern .section-heading .eyebrow {
  letter-spacing: 0.12em;
}

.mhm-modern .section-heading h2 {
  color: var(--m-navy);
  letter-spacing: -0.03em;
}

/* ---------- Steps: connected timeline ---------- */
.mhm-modern .steps-section {
  background: #f6f8fb;
}

.mhm-modern .steps-grid {
  position: relative;
  counter-reset: step;
}

.mhm-modern .steps-grid::before {
  content: "";
  position: absolute;
  top: 52px;
  left: 8%;
  right: 8%;
  height: 2px;
  background: linear-gradient(90deg, var(--m-teal), var(--m-violet), var(--m-gold));
  transform-origin: 0 50%;
  transform: scaleX(var(--mhm-line, 0));
  transition: transform 1.2s var(--m-ease);
  opacity: 0.6;
}

.mhm-modern .step-card {
  position: relative;
  border: 1px solid rgba(11, 20, 36, 0.06);
  border-radius: var(--m-radius);
  background: var(--m-card);
  backdrop-filter: blur(10px);
  transition: transform 0.35s var(--m-ease), box-shadow 0.35s ease, border-color 0.35s ease;
}

.mhm-modern .step-card:hover {
  transform: translateY(-6px);
  border-color: var(--m-ring);
  box-shadow: 0 24px 50px rgba(11, 20, 36, 0.12);
}

.mhm-modern .step-card span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--m-teal), var(--m-teal-deep));
  font-size: 18px;
  box-shadow: 0 12px 26px rgba(8, 127, 120, 0.3);
}

.mhm-modern .step-card:nth-child(2) span {
  background: linear-gradient(135deg, #8d76ff, var(--m-violet));
  box-shadow: 0 12px 26px rgba(115, 87, 255, 0.3);
}

.mhm-modern .step-card:nth-child(3) span {
  color: #4a2f00;
  background: linear-gradient(135deg, #f6cd85, var(--m-gold));
  box-shadow: 0 12px 26px rgba(233, 179, 92, 0.35);
}

/* ---------- Catalog: filters + cards ---------- */
.mhm-modern .catalog-section {
  background: #fff;
}

.mhm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 26px;
}

.mhm-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mhm-filters button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(11, 20, 36, 0.1);
  border-radius: 999px;
  background: #fff;
  color: #46536b;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mhm-filters button small {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #eef2f6;
  font-size: 11px;
}

.mhm-filters button:hover {
  border-color: var(--m-ring);
  color: var(--m-navy);
}

.mhm-filters button[aria-pressed="true"] {
  border-color: var(--m-navy);
  background: var(--m-navy);
  color: #fff;
}

.mhm-filters button[aria-pressed="true"] small {
  background: rgba(255, 255, 255, 0.18);
}

.mhm-search {
  position: relative;
  flex: 0 1 280px;
}

.mhm-search input {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  padding: 0 14px 0 40px;
  border: 1px solid rgba(11, 20, 36, 0.12);
  border-radius: 12px;
  background: #f6f8fb;
  color: var(--m-ink);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mhm-search input:focus {
  outline: none;
  border-color: var(--m-teal);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(10, 165, 155, 0.15);
}

.mhm-search svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 17px;
  height: 17px;
  color: #8a95a8;
  transform: translateY(-50%);
  pointer-events: none;
}

.mhm-empty {
  grid-column: 1 / -1;
  padding: 40px;
  border: 1px dashed rgba(11, 20, 36, 0.15);
  border-radius: var(--m-radius);
  color: var(--m-muted);
  text-align: center;
  font-weight: 700;
}

.mhm-modern .module-card {
  position: relative;
  border: 1px solid rgba(11, 20, 36, 0.07);
  border-radius: var(--m-radius);
  box-shadow: 0 10px 30px rgba(11, 20, 36, 0.06);
  transition: transform 0.4s var(--m-ease), box-shadow 0.4s ease, border-color 0.4s ease, opacity 0.3s ease;
}

/* Cursor spotlight */
.mhm-modern .module-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(10, 165, 155, 0.1), transparent 45%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mhm-modern .module-card:hover::before {
  opacity: 1;
}

.mhm-modern .module-card:hover {
  transform: translateY(-8px);
  border-color: var(--m-ring);
  box-shadow: 0 30px 60px rgba(11, 20, 36, 0.14);
}

.mhm-modern .module-card.featured {
  border: 1.5px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, var(--m-gold), var(--m-violet), var(--m-teal)) border-box;
}

.mhm-modern .module-card.featured .card-meta .badge::before {
  content: "★ ";
}

.mhm-modern .module-card.incoming {
  border-style: dashed;
}

.mhm-modern .module-card.incoming:hover {
  transform: translateY(-3px);
}

.mhm-modern .module-thumb {
  overflow: hidden;
  background: linear-gradient(135deg, #eaf6f3, #f0edff);
}

.mhm-modern .module-thumb > * {
  transition: transform 0.6s var(--m-ease);
}

.mhm-modern .module-card:hover .module-thumb > * {
  transform: scale(1.04);
}

.mhm-modern .module-card .card-meta > span:first-child {
  color: var(--m-teal-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mhm-modern .module-card .button.small:not(.disabled) {
  border: 0;
  border-radius: 12px;
  background: var(--m-navy);
  color: #fff;
}

.mhm-modern .module-card .button.small:not(.disabled)::after {
  content: "→";
  margin-left: 8px;
  transition: transform 0.25s var(--m-ease);
}

.mhm-modern .module-card:hover .button.small:not(.disabled) {
  background: linear-gradient(135deg, var(--m-teal), var(--m-teal-deep));
}

.mhm-modern .module-card:hover .button.small:not(.disabled)::after {
  transform: translateX(4px);
}

.mhm-modern .module-card[hidden] {
  display: none;
}

.mhm-modern .module-card.mhm-in {
  animation: mhm-pop 0.45s var(--m-ease) both;
}

/* Discount ribbon injected by JS */
.mhm-save {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  padding: 7px 11px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #ff5f6d, #ff8a3d);
  box-shadow: 0 10px 22px rgba(255, 95, 109, 0.35);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.02em;
}

/* ---------- Final CTA band ---------- */
.mhm-cta {
  position: relative;
  overflow: hidden;
  margin: 0 clamp(16px, 4vw, 72px) clamp(40px, 6vw, 80px);
  padding: clamp(36px, 6vw, 72px);
  border-radius: 32px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 10%, rgba(115, 87, 255, 0.55), transparent 40%),
    radial-gradient(circle at 0% 100%, rgba(112, 231, 196, 0.35), transparent 40%),
    var(--m-navy);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
}

.mhm-cta h2 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.mhm-cta p {
  margin: 0;
  max-width: 560px;
  color: #b4c0d4;
  font-size: 17px;
  line-height: 1.6;
}

.mhm-cta .button.primary {
  min-height: 58px;
  padding: 0 28px;
  border-radius: 16px;
  background: var(--m-mint);
  color: #0d3d39;
  box-shadow: 0 18px 40px rgba(112, 231, 196, 0.3);
}

/* ---------- Footer ---------- */
.mhm-modern .site-footer {
  background: #fff;
  border-top: 1px solid rgba(11, 20, 36, 0.06);
}

/* ---------- Back to top ---------- */
.mhm-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--m-navy);
  box-shadow: 0 14px 30px rgba(11, 20, 36, 0.28);
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s var(--m-ease), background 0.2s ease;
}

.mhm-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.mhm-top:hover {
  background: var(--m-teal-deep);
}

/* Purchase popup: softer toast */
.mhm-modern .purchase-popup {
  top: auto;
  bottom: 20px;
  left: 20px;
  width: min(420px, calc(100vw - 40px));
  padding: 16px 18px 16px 58px;
  border-radius: 18px;
  color: var(--m-ink);
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(11, 20, 36, 0.08);
  box-shadow: 0 24px 50px rgba(11, 20, 36, 0.18);
  backdrop-filter: blur(12px);
  transform: translateY(14px);
}

.mhm-modern .purchase-popup::before {
  content: "🛒";
  position: absolute;
  top: 50%;
  left: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #dcfaf0;
  font-size: 16px;
  transform: translateY(-50%);
}

.mhm-modern .purchase-popup.is-visible {
  transform: none;
}

.mhm-modern .purchase-popup p,
.mhm-modern .purchase-popup strong,
.mhm-modern .purchase-popup b {
  color: var(--m-ink);
  font-size: 14px;
}

.mhm-modern .purchase-popup b {
  color: var(--m-teal-deep);
}

/* ---------- Reveal on scroll ---------- */
.mhm-modern .mhm-reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--m-ease), transform 0.8s var(--m-ease);
  transition-delay: var(--d, 0s);
}

.mhm-modern .mhm-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Keyframes ---------- */
@keyframes mhm-drift {
  to { transform: translate(-60px, 50px) scale(1.12); }
}

@keyframes mhm-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

@keyframes mhm-shine {
  to { background-position: 200% center; }
}

@keyframes mhm-pulse {
  70% { box-shadow: 0 0 0 10px rgba(32, 208, 154, 0); }
  100% { box-shadow: 0 0 0 0 rgba(32, 208, 154, 0); }
}

@keyframes mhm-blink {
  50% { opacity: 0; }
}

@keyframes mhm-pop {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .mhm-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: -30px 16px 0;
  }

  .mhm-modern .steps-grid::before {
    display: none;
  }

  .mhm-cta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .mhm-modern .hero {
    min-height: 0;
  }

  .mhm-modern .site-header nav a[href="/login"] {
    margin-left: 0;
  }

  .mhm-toolbar {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
  }

  .mhm-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 2px 16px 6px;
    scrollbar-width: none;
  }

  .mhm-filters::-webkit-scrollbar {
    display: none;
  }

  .mhm-filters button {
    flex: 0 0 auto;
  }

  .mhm-search {
    flex-basis: auto;
  }

  .mhm-cta .button.primary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mhm-modern *,
  .mhm-modern *::before,
  .mhm-modern *::after {
    animation: none !important;
    transition: none !important;
  }

  .mhm-modern .mhm-reveal {
    opacity: 1;
    transform: none;
  }
}
