/* ==========================================================================
   JMatrix Learn - welcome gate + landing page layer
   Sits on top of skillforge.css (tokens) and Bootstrap.
   ========================================================================== */

:root {
  --jm-night: #0f0524;
  --jm-deep: #1e0b4a;
  --jm-violet: #6d28d9;
  --jm-glow: #a78bfa;
  --jm-gold: #fbbf24;
  --jm-ease: cubic-bezier(.22, .61, .36, 1);
}

/* ------------------------------------------------------------ Welcome gate */
.jm-welcome {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(1200px 700px at 15% 10%, rgba(109, 40, 217, .55), transparent 60%),
    radial-gradient(900px 600px at 90% 90%, rgba(251, 191, 36, .22), transparent 60%),
    linear-gradient(160deg, var(--jm-night), var(--jm-deep) 55%, #2a0f63);
  display: flex;
  flex-direction: column;
  font-family: var(--sf-font-body);
}
.jm-welcome canvas#jmEmbers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.jm-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: jmFloat 14s ease-in-out infinite; pointer-events: none; }
.jm-orb.o1 { width: 340px; height: 340px; background: #7c3aed; top: -80px; left: -60px; }
.jm-orb.o2 { width: 280px; height: 280px; background: #f59e0b; bottom: -90px; right: 8%; animation-delay: -5s; opacity: .35; }
.jm-orb.o3 { width: 220px; height: 220px; background: #38bdf8; top: 40%; right: -70px; animation-delay: -9s; opacity: .25; }
@keyframes jmFloat { 0%,100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(30px,-40px,0) scale(1.12); } }

.jm-welcome-top { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 22px clamp(18px, 4vw, 48px); }
.jm-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-family: var(--sf-font-display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.jm-brand i { color: var(--jm-gold); font-size: 1.4rem; }
.jm-brand:hover { color: #fff; }
.jm-skip { color: rgba(255,255,255,.7); font-size: .9rem; border: 1px solid rgba(255,255,255,.25); padding: 6px 14px; border-radius: 999px; transition: .2s; }
.jm-skip:hover { color: #fff; border-color: #fff; background: rgba(255,255,255,.08); }

.jm-welcome-main { position: relative; z-index: 2; flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px clamp(20px, 6vw, 80px) 30px; }
.jm-stage { max-width: 940px; width: 100%; }

.jm-greeting { font-size: clamp(.95rem, 1.6vw, 1.15rem); letter-spacing: .22em; text-transform: uppercase; color: var(--jm-gold); font-weight: 600; margin-bottom: 26px; opacity: 0; animation: jmRise .9s var(--jm-ease) .15s forwards; }

.jm-quote-wrap { position: relative; min-height: clamp(210px, 34vh, 330px); display: flex; align-items: center; justify-content: center; }
.jm-quote { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; opacity: 0; transform: translateY(18px); transition: opacity .9s var(--jm-ease), transform .9s var(--jm-ease); pointer-events: none; }
.jm-quote.is-on { opacity: 1; transform: none; pointer-events: auto; }
.jm-quote.is-off { opacity: 0; transform: translateY(-18px); }
.jm-quote h1 { font-family: var(--sf-font-display); font-weight: 800; font-size: clamp(1.9rem, 5.2vw, 3.9rem); line-height: 1.12; letter-spacing: -.02em; margin: 0; text-wrap: balance; text-shadow: 0 6px 40px rgba(124, 58, 237, .55); }
.jm-quote h1 .w { display: inline-block; opacity: 0; transform: translateY(14px); transition: opacity .6s var(--jm-ease), transform .6s var(--jm-ease); }
.jm-quote.is-on h1 .w { opacity: 1; transform: none; }
.jm-quote p { font-size: clamp(1rem, 1.9vw, 1.3rem); color: rgba(255,255,255,.82); margin: 0; max-width: 640px; line-height: 1.55; text-wrap: balance; }

.jm-dots { display: flex; gap: 8px; justify-content: center; margin: 20px 0 6px; }
.jm-dots span { width: 7px; height: 7px; border-radius: 99px; background: rgba(255,255,255,.3); transition: .4s; }
.jm-dots span.on { width: 26px; background: var(--jm-gold); }

.jm-enter-row { margin-top: 26px; display: flex; flex-direction: column; align-items: center; gap: 14px; opacity: 0; transform: translateY(10px); transition: .8s var(--jm-ease); }
.jm-enter-row.is-ready { opacity: 1; transform: none; }
.jm-enter { position: relative; display: inline-flex; align-items: center; gap: 12px; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1f1300; font-weight: 800; font-family: var(--sf-font-display); font-size: 1.1rem; padding: 16px 38px; border-radius: 999px; box-shadow: 0 10px 40px rgba(245, 158, 11, .45); transition: transform .25s var(--jm-ease), box-shadow .25s; overflow: hidden; }
.jm-enter:hover { color: #1f1300; transform: translateY(-3px) scale(1.03); box-shadow: 0 16px 52px rgba(245, 158, 11, .6); }
.jm-enter i { transition: transform .25s; }
.jm-enter:hover i { transform: translateX(5px); }
.jm-enter::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); transform: translateX(-120%); animation: jmShine 3.4s ease-in-out 1.2s infinite; }
@keyframes jmShine { 0% { transform: translateX(-120%); } 55%,100% { transform: translateX(120%); } }

.jm-progress { width: min(320px, 70vw); height: 3px; background: rgba(255,255,255,.18); border-radius: 99px; overflow: hidden; }
.jm-progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--jm-glow), var(--jm-gold)); border-radius: 99px; }
.jm-hint { font-size: .8rem; color: rgba(255,255,255,.55); letter-spacing: .04em; }
.jm-hint kbd { background: rgba(255,255,255,.12); color: #fff; border-radius: 6px; padding: 1px 7px; font-size: .75rem; }

.jm-welcome-foot { position: relative; z-index: 2; text-align: center; padding: 0 20px 22px; color: rgba(255,255,255,.5); font-size: .85rem; }

@keyframes jmRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------ Landing hero */
.jm-hero {
  position: relative; overflow: hidden; color: #fff; padding: clamp(56px, 9vw, 110px) 0 clamp(60px, 9vw, 120px);
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(167, 139, 250, .45), transparent 60%),
    radial-gradient(700px 500px at 100% 100%, rgba(251, 191, 36, .22), transparent 60%),
    linear-gradient(155deg, var(--jm-night), var(--jm-deep) 60%, #3b1384);
}
.jm-hero .jm-orb { opacity: .35; }
.jm-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 70px; background: var(--sf-bg); clip-path: ellipse(75% 100% at 50% 100%); }
.jm-hero-inner { position: relative; z-index: 2; }

.jm-kicker { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(6px); color: #fde68a; padding: 7px 16px; border-radius: 999px; font-size: .85rem; font-weight: 600; margin-bottom: 22px; }
.jm-hero h1 { font-family: var(--sf-font-display); font-weight: 800; font-size: clamp(2rem, 4.4vw, 3.5rem); line-height: 1.07; letter-spacing: -.025em; margin-bottom: 20px; text-wrap: balance; }
.jm-rotor { display: inline-block; position: relative; color: var(--jm-gold); min-width: 2ch; white-space: nowrap; }
@media (max-width: 767px) { .jm-rotor { display: block; white-space: normal; min-height: 2.25em; } .jm-hero h1 br { display: none; } }
.jm-rotor::after { content: ""; display: inline-block; width: 3px; height: .9em; background: var(--jm-gold); margin-left: 6px; vertical-align: -.08em; animation: jmBlink 1s steps(1) infinite; }
@keyframes jmBlink { 50% { opacity: 0; } }
.jm-hero .lead { color: rgba(255,255,255,.85); font-size: clamp(1.02rem, 1.7vw, 1.28rem); max-width: 560px; line-height: 1.6; }

.jm-search { background: #fff; border-radius: 999px; padding: 6px 6px 6px 22px; display: flex; align-items: center; gap: 8px; max-width: 540px; box-shadow: 0 18px 50px rgba(0,0,0,.35); }
.jm-search input { border: 0; outline: 0; flex: 1; font-size: 1rem; background: transparent; min-width: 0; }
.jm-search button { border-radius: 999px; padding: 12px 24px; }

.jm-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn-jm-gold { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1f1300; font-weight: 800; border: 0; padding: 13px 28px; border-radius: 999px; box-shadow: 0 8px 28px rgba(245,158,11,.4); transition: .25s var(--jm-ease); }
.btn-jm-gold:hover { color: #1f1300; transform: translateY(-2px); box-shadow: 0 14px 36px rgba(245,158,11,.55); }
.btn-jm-ghost { border: 1.5px solid rgba(255,255,255,.45); color: #fff; font-weight: 700; padding: 12px 26px; border-radius: 999px; background: transparent; transition: .25s; }
.btn-jm-ghost:hover { background: #fff; color: var(--jm-deep); }

.jm-glass { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 22px; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.28); }
.jm-live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; margin-right: 8px; box-shadow: 0 0 0 0 rgba(239,68,68,.7); animation: jmPulse 1.8s infinite; }
@keyframes jmPulse { 70% { box-shadow: 0 0 0 10px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
.jm-live-item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.14); }
.jm-live-item:first-of-type { border-top: 0; }
.jm-live-date { flex: 0 0 56px; text-align: center; background: rgba(255,255,255,.14); border-radius: 12px; padding: 6px 0; line-height: 1.1; }
.jm-live-date b { display: block; font-size: 1.3rem; font-family: var(--sf-font-display); }
.jm-live-date span { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #fde68a; }
.jm-live-item small { color: rgba(255,255,255,.7); }

.jm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; text-align: center; }
.jm-stats b { display: block; font-family: var(--sf-font-display); font-size: 1.7rem; color: var(--jm-gold); }
.jm-stats span { font-size: .78rem; color: rgba(255,255,255,.75); }

/* ------------------------------------------------------------ Sections */
.jm-section { padding: clamp(40px, 6vw, 80px) 0; }
.jm-eyebrow { display: inline-block; color: var(--sf-primary); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .78rem; margin-bottom: 10px; }
.jm-title { font-family: var(--sf-font-display); font-weight: 800; font-size: clamp(1.7rem, 3.6vw, 2.6rem); letter-spacing: -.02em; line-height: 1.15; text-wrap: balance; }
.jm-sub { color: var(--sf-muted); font-size: 1.08rem; max-width: 640px; }

.jm-values { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-top: -58px; position: relative; z-index: 5; }
.jm-value { background: #fff; border: 1px solid var(--sf-border); border-radius: 18px; padding: 20px; display: flex; gap: 14px; align-items: flex-start; box-shadow: 0 10px 30px rgba(76,29,149,.1); transition: .3s var(--jm-ease); }
.jm-value:hover { transform: translateY(-4px); box-shadow: 0 18px 44px rgba(76,29,149,.18); }
.jm-value i { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border-radius: 12px; background: var(--sf-primary-light); color: var(--sf-primary); font-size: 1.3rem; }
.jm-value b { display: block; font-family: var(--sf-font-display); font-size: .98rem; }
.jm-value span { font-size: .85rem; color: var(--sf-muted); }

.jm-path { position: relative; height: 100%; border-radius: 24px; padding: 30px; color: #fff; overflow: hidden; display: flex; flex-direction: column; transition: transform .35s var(--jm-ease), box-shadow .35s; box-shadow: 0 14px 40px rgba(17,24,39,.16); }
.jm-path:hover { transform: translateY(-8px); box-shadow: 0 26px 60px rgba(76,29,149,.3); color: #fff; }
.jm-path::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; right: -90px; top: -90px; background: rgba(255,255,255,.12); }
.jm-path.p1 { background: linear-gradient(150deg, #4c1d95, #7c3aed); }
.jm-path.p2 { background: linear-gradient(150deg, #0f766e, #14b8a6); }
.jm-path.p3 { background: linear-gradient(150deg, #b45309, #f59e0b); }
.jm-path .ico { font-size: 2.2rem; margin-bottom: 14px; }
.jm-path h3 { font-size: 1.45rem; margin-bottom: 8px; }
.jm-path p { color: rgba(255,255,255,.88); font-size: .95rem; flex: 1; }
.jm-path .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 18px; }
.jm-path .tags span { background: rgba(255,255,255,.18); padding: 3px 11px; border-radius: 99px; font-size: .75rem; font-weight: 600; }
.jm-path .go { font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.jm-path:hover .go i { transform: translateX(5px); }
.jm-path .go i { transition: .25s; }

.jm-steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.jm-step { position: relative; background: #fff; border: 1px solid var(--sf-border); border-radius: 20px; padding: 26px 22px 22px; transition: .3s var(--jm-ease); }
.jm-step:hover { border-color: var(--sf-primary); transform: translateY(-4px); }
.jm-step::before { counter-increment: s; content: counter(s); position: absolute; top: -16px; left: 22px; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--sf-primary), #a78bfa); color: #fff; font-weight: 800; display: grid; place-items: center; font-family: var(--sf-font-display); box-shadow: 0 6px 16px rgba(109,40,217,.4); }
.jm-step i { font-size: 1.7rem; color: var(--sf-primary); }
.jm-step h5 { margin: 10px 0 6px; font-size: 1.05rem; }
.jm-step p { margin: 0; font-size: .9rem; color: var(--sf-muted); }

.jm-mastery { background: linear-gradient(135deg, #1e0b4a, #3b1384); color: #fff; border-radius: 28px; padding: clamp(26px, 5vw, 56px); position: relative; overflow: hidden; }
.jm-mastery::after { content: ""; position: absolute; width: 340px; height: 340px; right: -100px; bottom: -140px; border-radius: 50%; background: radial-gradient(circle, rgba(251,191,36,.35), transparent 70%); }
.jm-ladder { display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 2; }
.jm-rung { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 12px 16px; font-weight: 600; }
.jm-rung i { font-size: 1.2rem; }
.jm-rung.done i { color: #4ade80; }
.jm-rung.now { border-color: var(--jm-gold); background: rgba(251,191,36,.14); }
.jm-rung.now i { color: var(--jm-gold); }
.jm-rung.lock { opacity: .55; }

.jm-duo { height: 100%; border-radius: 24px; padding: 30px; background: #fff; border: 1px solid var(--sf-border); box-shadow: var(--sf-shadow); transition: .3s var(--jm-ease); }
.jm-duo:hover { box-shadow: var(--sf-shadow-lg); transform: translateY(-4px); }
.jm-duo .ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 14px; background: var(--sf-primary-light); color: var(--sf-primary); }

.jm-final { position: relative; overflow: hidden; text-align: center; color: #fff; border-radius: 32px; padding: clamp(40px, 7vw, 84px) 24px; background: radial-gradient(700px 400px at 50% 0%, rgba(167,139,250,.55), transparent 65%), linear-gradient(150deg, var(--jm-night), #3b1384); box-shadow: 0 30px 80px rgba(76,29,149,.35); }
.jm-final h2 { font-family: var(--sf-font-display); font-weight: 800; font-size: clamp(1.8rem, 4.4vw, 3.1rem); letter-spacing: -.02em; text-wrap: balance; transition: opacity .6s; }
.jm-final p { color: rgba(255,255,255,.82); max-width: 560px; margin: 12px auto 26px; font-size: 1.08rem; transition: opacity .6s; }

/* reveal on scroll */
.jm-reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--jm-ease), transform .8s var(--jm-ease); }
.jm-reveal.is-in { opacity: 1; transform: none; }
.jm-reveal.d1 { transition-delay: .08s; } .jm-reveal.d2 { transition-delay: .16s; } .jm-reveal.d3 { transition-delay: .24s; }

/* ------------------------------------------------- Global polish (all pages) */
.sf-navbar { backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); }
.sf-card-hover { transition: transform .3s var(--jm-ease), box-shadow .3s; }
.sf-card-hover:hover { transform: translateY(-5px); }
:focus-visible { outline: 3px solid rgba(109,40,217,.45); outline-offset: 2px; border-radius: 6px; }
html { scroll-behavior: smooth; }

@media (max-width: 576px) {
  .jm-values { margin-top: -40px; }
  .jm-search button span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .jm-reveal { opacity: 1; transform: none; }
  .jm-greeting, .jm-enter-row { opacity: 1; transform: none; }
}

/* Floating feedback button */
.jm-feedback-fab { position: fixed; right: 18px; bottom: 18px; z-index: 1030; display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, #6d28d9, #8b5cf6); color: #fff; font-weight: 700; padding: 11px 18px; border-radius: 999px; box-shadow: 0 10px 28px rgba(76,29,149,.4); transition: transform .25s var(--jm-ease), box-shadow .25s; }
.jm-feedback-fab:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 16px 36px rgba(76,29,149,.5); }
@media (max-width: 576px) { .jm-feedback-fab span { display: none; } .jm-feedback-fab { padding: 13px; } }
