/* ═══════════════════════════════════════════════════════════════
   Homepage motion — feature tour (clips), spotlight on screenshots,
   live mini-demo and live friends feed. Used by welcome.html.
   Everything respects prefers-reduced-motion.
   ═══════════════════════════════════════════════════════════════ */

/* ── shared browser frame ── */
.hm-frame { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-light); background: var(--bg-card); box-shadow: 0 30px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(34,197,94,0.08), 0 0 120px rgba(34,197,94,0.06); }
.hm-bar { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; background: #0b0e12; border-bottom: 1px solid var(--border); }
.hm-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a3442; font-style: normal; }
.hm-bar i:nth-child(1) { background: #ef4444; } .hm-bar i:nth-child(2) { background: #f59e0b; } .hm-bar i:nth-child(3) { background: #22c55e; }
.hm-bar span { margin-left: 12px; padding: 4px 14px; border-radius: 6px; background: #12171e; font-family: var(--mono); font-size: 11.5px; color: var(--text-muted); }

/* ═══ 1. Feature tour: tabs + recorded clips ═══ */
.hm-tour { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto 90px; padding: 0 24px; }
.hm-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 26px 0 20px; }
.hm-tab { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 16px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(14,17,21,0.7); color: var(--text-muted); font: 600 14px var(--font); cursor: pointer; overflow: hidden; transition: color .2s, border-color .2s, background .2s; }
.hm-tab i { font-size: 17px; }
.hm-tab:hover { color: var(--text); border-color: var(--border-light); }
.hm-tab.on { color: var(--text); border-color: rgba(34,197,94,0.55); background: rgba(34,197,94,0.08); }
.hm-tab.on i { color: var(--accent); }
.hm-tab b { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--accent); box-shadow: 0 0 10px rgba(34,197,94,.7); }
.hm-tour-body { display: grid; grid-template-columns: 1fr 290px; gap: 28px; align-items: center; }
.hm-stage { position: relative; aspect-ratio: 16 / 10; background: #080a0c; }
.hm-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; opacity: 0; transition: opacity .45s ease; }
.hm-stage video.on, .hm-stage > div.on { opacity: 1; }
.hm-stage > div { position: absolute; inset: 0; opacity: 0; transition: opacity .45s ease; overflow: hidden; }
.hm-stage > div .hm-feed { min-height: 100%; height: 100%; box-sizing: border-box; }
.hm-cap h3 { font-family: var(--font-condensed); font-size: 30px; font-weight: 800; line-height: 1.05; margin: 0 0 10px; }
.hm-cap h3 em { font-style: normal; color: var(--accent); }
.hm-cap p { color: var(--text-muted); font-size: 15px; line-height: 1.6; margin: 0 0 16px; }
.hm-cap ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.hm-cap li { display: flex; gap: 8px; font-size: 14px; color: var(--text); }
.hm-cap li i { color: var(--accent); margin-top: 2px; }
.hm-cap .hm-fade { animation: hmUp .45s ease both; }
@keyframes hmUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .hm-tour-body { grid-template-columns: 1fr; }
  .hm-tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 6px; scrollbar-width: none; }
  .hm-tabs::-webkit-scrollbar { display: none; }
  .hm-tab { flex: none; }
}

/* ═══ 2. Spotlight: camera moves over a screenshot with callouts ═══ */
.hm-spot { position: relative; overflow: hidden; }
.hm-spot .hm-cam { transform-origin: 0 0; transition: transform 1.5s cubic-bezier(.65,0,.35,1); will-change: transform; }
.hm-spot .hm-cam img { display: block; width: 100%; height: auto; }
.hm-spot .hm-dim { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 38% 34% at 50% 50%, transparent 60%, rgba(4,6,8,0.32) 100%); opacity: 0; transition: opacity .8s; }
.hm-spot.zoomed .hm-dim { opacity: 1; }
.hm-call { position: absolute; left: 50%; bottom: 7%; transform: translate(-50%, 14px); max-width: min(560px, 86%); display: flex; align-items: center; gap: 12px; padding: 13px 18px; border-radius: 14px; background: rgba(8,11,14,0.92); border: 1px solid rgba(34,197,94,0.55); box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 0 30px rgba(34,197,94,.2); backdrop-filter: blur(8px); opacity: 0; transition: opacity .45s, transform .45s; }
.hm-call.on { opacity: 1; transform: translate(-50%, 0); }
.hm-call i { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(34,197,94,.15); color: var(--accent); font-size: 18px; }
.hm-call b { display: block; font-family: var(--font-condensed); font-size: 19px; font-weight: 800; letter-spacing: .3px; }
.hm-call span { display: block; font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.hm-dots { position: absolute; right: 14px; top: 46px; display: flex; gap: 6px; z-index: 2; }
.hm-dots u { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.18); transition: background .3s, transform .3s; }
.hm-dots u.on { background: var(--accent); transform: scale(1.3); }
@media (max-width: 640px) { .hm-call { bottom: 4%; padding: 9px 12px; gap: 9px; } .hm-call b { font-size: 15px; } .hm-call span { font-size: 11.5px; } .hm-call i { width: 28px; height: 28px; font-size: 15px; } }

/* ═══ 3. Live mini-demo (coded, no pictures) ═══ */
.hm-live { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto 80px; padding: 0 24px; }
.hm-app { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; padding: 16px; background: radial-gradient(ellipse at 15% 0%, rgba(34,197,94,.07), transparent 55%), #0a0d11; }
.hm-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; grid-column: 1 / -1; }
.hm-k { padding: 13px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-card); }
.hm-k small { display: block; font: 700 10px var(--font-condensed); letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.hm-k b { font: 600 24px var(--mono); color: var(--text); }
.hm-k b.g { color: var(--accent); }
.hm-card { border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); padding: 14px; position: relative; overflow: hidden; }
.hm-card h4 { margin: 0 0 10px; font: 700 12px var(--font-condensed); letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); display: flex; justify-content: space-between; }
.hm-card h4 em { font-style: normal; color: var(--accent); }
.hm-eq svg { width: 100%; height: 190px; display: block; }
.hm-eq .line { fill: none; stroke: #4ade80; stroke-width: 2.5; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(34,197,94,.6)); }
.hm-eq .area { fill: url(#hmGrad); opacity: 0; transition: opacity 1s; }
.hm-eq.drawn .area { opacity: 1; }
.hm-score { display: flex; align-items: center; gap: 16px; }
.hm-ring { position: relative; width: 120px; height: 120px; flex: none; }
.hm-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hm-ring circle { fill: none; stroke-width: 11; }
.hm-ring .tr { stroke: rgba(255,255,255,.07); }
.hm-ring .fg { stroke: var(--accent); stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(34,197,94,.6)); transition: stroke-dashoffset 1.8s cubic-bezier(.3,.7,.2,1); }
.hm-ring div { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.hm-ring div b { font: 800 36px var(--font-condensed); color: var(--accent); line-height: 1; }
.hm-ring div small { display: block; font: 700 9px var(--font-condensed); letter-spacing: 1.5px; color: var(--text-muted); }
.hm-bars { flex: 1; display: grid; gap: 8px; }
.hm-bars div { font-size: 11.5px; color: var(--text-muted); display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; }
.hm-bars div span { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; }
.hm-bars div span i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #ef4444, #f59e0b 45%, #22c55e); transition: width 1.6s cubic-bezier(.3,.7,.2,1); }
.hm-trades { display: grid; gap: 7px; }
.hm-tr { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px; background: var(--bg-card2); border: 1px solid var(--border); font-size: 12.5px; animation: hmSlide .5s cubic-bezier(.2,.9,.2,1) both; }
.hm-tr .sd { font: 700 10px var(--font-condensed); letter-spacing: 1px; padding: 3px 7px; border-radius: 5px; }
.hm-tr .sd.l { background: rgba(34,197,94,.15); color: #4ade80; } .hm-tr .sd.s { background: rgba(239,68,68,.15); color: #f87171; }
.hm-tr .sym { font-family: var(--mono); font-weight: 600; } .hm-tr .sym small { display: block; font: 500 11px var(--font); color: var(--text-muted); }
.hm-tr .r { font: 600 13px var(--mono); } .hm-tr .r.g { color: #4ade80; } .hm-tr .r.x { color: #f87171; }
.hm-gr { width: 30px; height: 26px; border-radius: 7px; display: grid; place-items: center; font: 800 13px var(--font-condensed); animation: hmPop .45s .35s cubic-bezier(.3,1.6,.5,1) both; }
.hm-gr.a { background: rgba(34,197,94,.18); color: #4ade80; border: 1px solid rgba(34,197,94,.4); }
.hm-gr.b { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.35); }
.hm-gr.c { background: rgba(239,68,68,.14); color: #f87171; border: 1px solid rgba(239,68,68,.35); }
@keyframes hmSlide { from { opacity: 0; transform: translateY(-14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes hmPop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
.hm-coach { display: flex; gap: 12px; align-items: flex-start; }
.hm-coach .av { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(34,197,94,.15); color: var(--accent); font-size: 18px; }
.hm-coach .q { font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.hm-coach .a { font-size: 14px; line-height: 1.55; min-height: 44px; }
.hm-coach .a b { color: #4ade80; font-weight: 700; }
.hm-caret { display: inline-block; width: 7px; height: 15px; background: var(--accent); vertical-align: -2px; margin-left: 2px; animation: hmBlink .8s steps(1) infinite; }
@keyframes hmBlink { 50% { opacity: 0; } }
@media (max-width: 900px) { .hm-app { grid-template-columns: 1fr; } .hm-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ═══ 3b. Live friends feed ═══ */
.hm-feed { padding: 16px; background: radial-gradient(ellipse at 80% 0%, rgba(34,197,94,.06), transparent 55%), #0a0d11; min-height: 470px; }
.hm-now { display: flex; gap: 10px; margin-bottom: 14px; overflow: hidden; }
.hm-now > div { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-card); font-size: 12.5px; transition: border-color .4s, background .4s; }
.hm-now > div.live { border-color: rgba(34,197,94,.55); background: rgba(34,197,94,.06); }
.hm-now b { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.hm-now span { display: block; color: var(--text-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-now .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); }
.hm-now .live .dot { background: var(--accent); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: hmPing 1.6s infinite; }
@keyframes hmPing { 70% { box-shadow: 0 0 0 8px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.hm-posts { display: grid; gap: 10px; }
.hm-post { padding: 13px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); animation: hmSlide .55s cubic-bezier(.2,.9,.2,1) both; }
.hm-post.out { animation: hmOut .4s ease both; }
@keyframes hmOut { to { opacity: 0; transform: translateY(10px); height: 0; padding: 0; margin: 0; } }
.hm-post .hd { display: flex; align-items: center; gap: 10px; }
.hm-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 14px var(--font); background: #11331f; color: #4ade80; flex: none; }
.hm-post .hd > div:not(.hm-av) { flex: 1; min-width: 0; } .hm-post .ft em { font-style: normal; } .hm-post .hd b { font-size: 14px; } .hm-post .hd small { display: block; color: var(--text-muted); font-size: 11.5px; }
.hm-post .r { font: 700 19px var(--mono); } .hm-post .r.g { color: #4ade80; } .hm-post .r.x { color: #f87171; }
.hm-post p { margin: 9px 0 8px; font-size: 13.5px; color: #c8d2df; line-height: 1.5; }
.hm-post .ft { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); align-items: center; }
.hm-post .ft span { display: flex; align-items: center; gap: 4px; }
.hm-post .ft .bump { animation: hmPop .4s cubic-bezier(.3,1.6,.5,1); color: #fbbf24; }
.hm-cm { margin-top: 9px; padding: 8px 10px; border-radius: 9px; background: var(--bg-card2); font-size: 12.5px; color: #c8d2df; animation: hmSlide .45s ease both; }
.hm-cm b { color: var(--text); margin-right: 5px; }
.hm-cm b.coach { color: #a78bfa; }

/* ═══ 4. side-by-side layout for the friends section ═══ */
.hm-social-live { display: grid; gap: 10px; }

@media (prefers-reduced-motion: reduce) {
  .hm-spot .hm-cam, .hm-ring .fg, .hm-bars div span i { transition: none !important; }
  .hm-tr, .hm-post, .hm-cm, .hm-gr, .hm-cap .hm-fade { animation: none !important; }
}

/* ═══ 5. Live mentor view (Friends section) ═══ */
.hm-mentor { padding: 16px; background: radial-gradient(ellipse at 85% 0%, rgba(167,139,250,.06), transparent 55%), #0a0d11; }
.hm-mh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.hm-mh b { font: 700 13px var(--font-condensed); letter-spacing: 1.5px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.hm-mh b i { color: var(--accent); font-size: 16px; }
.hm-mh span { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.hm-mh span u { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: hmPing 1.6s infinite; }
.hm-mt { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg-card); }
.hm-mr { display: grid; grid-template-columns: 1.35fr .9fr .55fr 1.5fr .95fr .9fr; align-items: center; gap: 8px; padding: 11px 14px; border-top: 1px solid var(--border); font-size: 13px; transition: background .5s; }
.hm-mr:first-child { border-top: 0; }
.hm-mr.hd { font: 700 10px var(--font-condensed); letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted); background: rgba(255,255,255,.015); padding: 9px 14px; }
.hm-mr.flash-r { background: rgba(239,68,68,.10); } .hm-mr.flash-g { background: rgba(34,197,94,.08); } .hm-mr.flash-y { background: rgba(245,158,11,.08); }
.hm-mr .who { display: flex; align-items: center; gap: 9px; font-weight: 600; min-width: 0; }
.hm-mr .who .hm-av { width: 28px; height: 28px; font-size: 12px; }
.hm-mr .who em { font-style: normal; font: 700 10px var(--font); padding: 2px 6px; border-radius: 999px; background: #ef4444; color: #fff; animation: hmPop .4s cubic-bezier(.3,1.6,.5,1); }
.hm-mr .num { font-family: var(--mono); font-weight: 600; } .hm-mr .num.g { color: #4ade80; } .hm-mr .num.x { color: #f87171; }
.hm-mr .num small { font: 500 11px var(--mono); color: var(--text-dim); margin-left: 4px; }
.hm-mr .tags { display: flex; gap: 5px; flex-wrap: wrap; min-width: 0; }
.hm-tag { font: 600 11px var(--font); padding: 3px 8px; border-radius: 6px; white-space: nowrap; animation: hmPop .4s cubic-bezier(.3,1.6,.5,1) both; }
.hm-tag.y { background: rgba(245,158,11,.14); color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
.hm-tag.r { background: rgba(239,68,68,.15); color: #f87171; border: 1px solid rgba(239,68,68,.4); box-shadow: 0 0 0 0 rgba(239,68,68,.5); animation: hmPop .4s cubic-bezier(.3,1.6,.5,1) both, hmPingR 1.6s .4s infinite; }
.hm-tag.ok { color: #4ade80; font-size: 14px; padding: 0; background: none; border: 0; }
@keyframes hmPingR { 70% { box-shadow: 0 0 0 7px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
.hm-disc { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-weight: 600; }
.hm-disc i { flex: 1; max-width: 54px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.07); overflow: hidden; display: block; }
.hm-disc i b { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width 1s cubic-bezier(.3,.7,.2,1), background .5s; }
.hm-disc.dn { color: #fbbf24; } .hm-disc.dn i b { background: #f59e0b; } .hm-disc.up { color: #4ade80; }
.hm-mr .jr { font-size: 12.5px; color: var(--text-muted); } .hm-mr .jr.g { color: #4ade80; font-weight: 600; }
.hm-mb { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.hm-mb > div { border: 1px solid var(--border); border-radius: 12px; background: var(--bg-card); padding: 12px 14px; min-height: 150px; }
.hm-mb h5 { margin: 0 0 9px; font: 700 11px var(--font-condensed); letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-muted); }
.hm-hw { display: grid; gap: 8px; }
.hm-hw div { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #c8d2df; }
.hm-hw div s { text-decoration: none; }
.hm-hw div.done s { color: var(--text-muted); text-decoration: line-through; text-decoration-color: rgba(122,138,158,.6); }
.hm-hw div small { margin-left: auto; color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }
.hm-cb { width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--border-light); flex: none; display: grid; place-items: center; transition: background .3s, border-color .3s; }
.hm-hw div.done .hm-cb { background: var(--accent); border-color: var(--accent); }
.hm-hw div.done .hm-cb:after { content: ''; width: 8px; height: 4px; border-left: 2px solid #04130a; border-bottom: 2px solid #04130a; transform: rotate(-45deg) translate(1px, -1px); animation: hmPop .35s cubic-bezier(.3,1.6,.5,1); }
.hm-al { display: grid; gap: 7px; }
.hm-al > div { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: #c8d2df; line-height: 1.4; animation: hmSlide .45s cubic-bezier(.2,.9,.2,1) both; }
.hm-al > div > div { flex: 1; min-width: 0; }
.hm-al > div i { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 14px; }
.hm-al > div i.r { background: rgba(239,68,68,.15); color: #f87171; } .hm-al div i.y { background: rgba(245,158,11,.14); color: #fbbf24; } .hm-al div i.g { background: rgba(34,197,94,.14); color: #4ade80; } .hm-al div i.p { background: rgba(167,139,250,.15); color: #a78bfa; }
.hm-al b { color: var(--text); } .hm-al small { display: block; color: var(--text-muted); font-size: 11px; }
.hm-mentor.fade > * { transition: opacity .5s; opacity: .25; }
@media (max-width: 760px) {
  .hm-mr { grid-template-columns: 1.4fr .9fr 1.3fr .9fr; }
  .hm-mr > :nth-child(3), .hm-mr > :nth-child(5) { display: none; }
  .hm-mb { grid-template-columns: 1fr; } .hm-mb > div { min-height: 0; }
}
@media (max-width: 460px) {
  .hm-mentor { padding: 10px; } .hm-mr { padding: 9px 10px; gap: 6px; font-size: 12px; grid-template-columns: 1.3fr .8fr 1.2fr; }
  .hm-mr > :nth-child(6) { display: none; } .hm-disc i { display: none; }
}
