/* Landing page: scroll motion and the "Inside MARS" menu tour (see landing.js).
   Colours come from styles.css (--purple, --purple-dark, --line, --ink, --muted).
   Everything that moves is skipped for people who prefer reduced motion. */

/* ------------------------------------------------------------------ Inside MARS: the app menu, scrolled through */
.welcome-inside{max-width:1200px;margin:0 auto;padding:40px clamp(22px,3.5vw,40px) 0}
.inside-pin{padding:28px 0 72px}
.inside-stage{
  display:grid;grid-template-columns:minmax(300px,380px) minmax(0,1fr);
  gap:clamp(28px,5vw,80px);align-items:center;width:100%;
}

/* the menu card (looks like the sidebar in the app) */
.inside-menu{
  --item-h:clamp(34px,5.3vh,50px);
  position:relative;padding:14px;background:#fff;border:1px solid #e4ddec;border-radius:22px;
  box-shadow:0 24px 60px rgba(60,40,120,.12);
}
.inside-workspace{display:flex;align-items:center;gap:12px;margin-bottom:6px;padding:10px 12px;border:1px solid #e4ddec;border-radius:14px}
.inside-workspace i{display:grid;place-items:center;flex:none;width:32px;height:32px;border-radius:9px;background:#e8dcff;color:var(--purple-dark);font-style:normal;font-weight:700}
.inside-workspace b{display:block;font-size:14.5px;color:var(--ink)}
.inside-workspace small{display:block;color:var(--muted);font-size:13px}
.inside-label{margin:14px 12px 4px;color:#75747c;font-size:12px;font-weight:700;letter-spacing:.14em}
.inside-item{
  position:relative;z-index:1;display:flex;align-items:center;gap:12px;width:100%;height:var(--item-h);
  padding:0 12px;border:0;border-radius:10px;background:none;
  color:#585563;font:inherit;font-size:15.5px;font-weight:500;text-align:left;cursor:pointer;
  transition:color .3s ease;-webkit-tap-highlight-color:transparent;
}
.inside-item .motion-icon{width:calc(var(--item-h) - 6px);height:calc(var(--item-h) - 6px)}
.inside-item span:not(.motion-icon){min-width:0;white-space:nowrap}
.inside-item:hover{color:var(--ink)}
.inside-item.is-active{color:var(--purple-dark);font-weight:650}
.inside-item:focus-visible{outline:2px solid var(--purple);outline-offset:-2px}
/* the highlight that slides down the menu as you scroll */
.inside-bar{
  position:absolute;left:0;top:0;z-index:0;width:var(--w,0);height:var(--h,0);
  transform:translate(var(--x,0),var(--y,0));
  background:#e6dcff;border-radius:10px;box-shadow:inset 3px 0 0 var(--purple);
  opacity:0;
}
.inside-menu.ready .inside-bar{opacity:1}

/* the description next to the menu */
.inside-side{display:flex;flex-direction:column;gap:22px;min-width:0}
.inside-panels{position:relative;min-height:clamp(300px,52vh,470px)}
.inside-panel{
  position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:14px;
  opacity:0;pointer-events:none;visibility:hidden;
}
.inside-panel.is-active{opacity:1;pointer-events:auto;visibility:visible}
.inside-art{
  display:grid;place-items:center;width:132px;height:132px;margin-bottom:4px;border-radius:34px;
  background:radial-gradient(circle at 30% 18%,#fff,#efe8ff);box-shadow:0 22px 50px rgba(113,56,216,.22);
}
.inside-art .motion-icon{width:96px;height:96px}
.inside-eyebrow{color:var(--purple-dark);font-size:12.5px;font-weight:700;letter-spacing:.16em}
.inside-panel h3{margin:0;font-family:Manrope,'DM Sans',sans-serif;font-size:clamp(30px,3.6vw,48px);font-weight:700;letter-spacing:-.03em;line-height:1.05;color:var(--ink)}
.inside-panel p{margin:0;max-width:520px;color:#4d4960;font-size:clamp(16px,1.5vw,19px);line-height:1.6}
.inside-panel .inside-note{color:var(--purple-dark);font-size:14.5px;font-weight:600}
.inside-chips{display:flex;flex-wrap:wrap;gap:8px}
.inside-chips span{padding:6px 13px;border:1px solid #e4ddec;border-radius:999px;background:#fff;color:#4d4960;font-size:13.5px;font-weight:600}
.inside-chips span.opt{border-color:transparent;background:#f1eefc;color:var(--purple-dark)}
.inside-foot{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.inside-count{color:var(--muted);font-size:14px;font-variant-numeric:tabular-nums;letter-spacing:.04em}
.inside-count b{color:var(--ink);font-size:18px}

/* pinned tour: the section stays on screen while the page scrolls through the menu (set by landing.js) */
html.inside-pinned .welcome-page{overflow:clip}
html.inside-pinned .inside-track{height:calc(100vh + var(--steps,11) * 26vh)}
html.inside-pinned .inside-pin{position:sticky;top:0;height:100vh;display:flex;align-items:center;padding:0}

/* tablets and phones */
@media (max-width:900px){
  .inside-stage{grid-template-columns:minmax(0,1fr);gap:16px}
  .inside-menu{--item-h:clamp(30px,4.6vh,40px);display:grid;grid-template-columns:1fr 1fr;column-gap:6px;padding:10px}
  .inside-workspace{display:none}
  .inside-label{grid-column:1/-1;margin:8px 8px 2px;font-size:11px}
  .inside-label:first-of-type{margin-top:2px}
  .inside-item{gap:8px;padding:0 8px;font-size:14px}
  .inside-item .motion-icon{width:calc(var(--item-h) - 8px);height:calc(var(--item-h) - 8px)}
  .inside-side{gap:14px}
  .inside-panels{min-height:clamp(250px,33vh,300px)}
  .inside-foot{margin-top:4px}
  .inside-panel{gap:10px;justify-content:flex-start}
  .inside-art{display:none}
  .inside-panel h3{font-size:clamp(26px,7vw,34px)}
  .inside-panel p{font-size:15.5px;line-height:1.5}
  html.inside-pinned .inside-pin{align-items:center}
}
@media (max-width:420px){
  .inside-item{font-size:13.5px;gap:6px;padding:0 6px}
  .inside-chips span{padding:5px 11px;font-size:13px}
}
@media (max-height:640px) and (max-width:900px){.inside-chips{display:none}}

/* the backend icon's server lights (same blink as the app) */
.motion-backend .motion-led{animation:led-blink 2.4s ease-in-out infinite}
.motion-backend .led-1{animation-delay:.6s}
.motion-backend .led-2{animation-delay:1.2s}
@keyframes led-blink{0%,100%{opacity:1}50%{opacity:.35}}

/* ------------------------------------------------------------------ motion */
@media (prefers-reduced-motion:no-preference){
  /* the hero's floating app tiles drift a little slower than the page */
  .welcome-icons{translate:0 calc(var(--hp,0) * 70px)}
  /* headings, the community artwork and the footer fade up as they arrive */
  html.reveal-on .reveal{opacity:0;translate:0 30px;transition:opacity .8s ease,translate .8s cubic-bezier(.2,.7,.2,1)}
  html.reveal-on .reveal.in{opacity:1;translate:0 0}
  /* the menu card slides in, then its items follow one by one */
  html.reveal-on .inside-menu.reveal{translate:-40px 0}
  html.reveal-on .inside-menu.reveal.in{translate:0 0}
  html.reveal-on .inside-menu .inside-item,html.reveal-on .inside-menu .inside-label{opacity:0;translate:-14px 0}
  html.reveal-on .inside-menu.in .inside-item,html.reveal-on .inside-menu.in .inside-label{
    opacity:1;translate:0 0;transition:opacity .5s ease,translate .5s cubic-bezier(.2,.8,.3,1),color .3s ease;
    transition-delay:calc(var(--k,0) * 55ms + 250ms),calc(var(--k,0) * 55ms + 250ms),0s;
  }
  .inside-bar{transition:transform .6s cubic-bezier(.3,.8,.2,1),width .4s ease,height .4s ease,opacity .4s ease}
  .inside-menu:not(.ready) .inside-bar{transition:none}
  .inside-item.is-active .motion-icon{transform:scale(1.12)}
  /* description: the current one rises in, the previous one leaves */
  .inside-panel{transform:translateY(28px);transition:opacity .45s ease,transform .6s cubic-bezier(.2,.8,.3,1),visibility 0s linear .6s}
  .inside-panel.is-active{transform:none;transition:opacity .5s ease .12s,transform .7s cubic-bezier(.2,.8,.3,1) .12s,visibility 0s}
  .inside-panel.is-active .inside-art{animation:inside-pop .8s cubic-bezier(.2,.9,.3,1.3) .1s both}
  .inside-panel.is-active>*:not(.inside-art){animation:inside-rise .6s cubic-bezier(.2,.8,.3,1) both}
  .inside-panel.is-active>.inside-eyebrow{animation-delay:.12s}
  .inside-panel.is-active>h3{animation-delay:.18s}
  .inside-panel.is-active>p{animation-delay:.26s}
  .inside-panel.is-active>.inside-chips{animation-delay:.34s}
  .inside-panel.is-active>.inside-note{animation-delay:.4s}
}
@keyframes inside-rise{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:none}}
@keyframes inside-pop{from{opacity:0;transform:scale(.6) rotate(-10deg)}to{opacity:1;transform:none}}
