/* Landing page styles — everything scoped under .vmup-home.
   Terminal mockup styles live in terminal.css (shared with the docs). */

.vmup-home {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2.4rem 1rem 4rem;
  width: 100%;
  /* .vmup-home is a flex/grid item of .md-container; without this its
     min-width is min-content and the unbreakable install one-liner
     forces the whole page wider than small viewports */
  min-width: 0;
  box-sizing: border-box;
}

/* --- Hero --- */

.vmup-hero {
  text-align: center;
  margin-bottom: 3rem;
  padding: 1.5rem 1rem 2rem;
  background-image: url("../logo/stars-bg-light.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

[data-md-color-scheme="slate"] .vmup-hero {
  background-image: url("../logo/stars-bg-dark.svg");
}

/* --- Rocket + wordmark lockup with periodic boost --- */

.vmup-hero-lockup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: 1.6rem 0 1.2rem;
  margin-bottom: 0.4rem;
}

.vmup-hero-rocket {
  position: relative;
  width: 4.2rem;
  height: 4.2rem;
  animation: vmup-boost-shake 7s infinite;
}

.vmup-hero-rocket img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Scheme swap inside the rocket uses visibility, not display: a
   display:none'd flame restarts its animation clock when revealed, so a
   palette toggle would knock the flame out of phase with the shake. The
   imgs are absolutely stacked, so the hidden pair takes no space. */
[data-md-color-scheme="default"] .vmup-hero-rocket .vmup-only-dark,
[data-md-color-scheme="slate"] .vmup-hero-rocket .vmup-only-light {
  display: block !important;
  visibility: hidden;
}

.vmup-hero-word {
  font-family: var(--md-code-font-family);
  font-weight: 700;
  font-size: 3.1rem;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #2b2b3a;
}

[data-md-color-scheme="slate"] .vmup-hero-word {
  color: #ffffff;
}

.vmup-hero-word-accent {
  color: var(--md-accent-fg-color);
}

/* Boost on a 7s loop: long flame and shake start together (58%), the
   shake settles at 73.5% (~1.1s), the flame holds long for ~0.9s more,
   then returns to its short size (86.5%) */
.vmup-hero-rocket .vmup-rocket-boost {
  opacity: 0;
  animation: vmup-boost-flame 7s infinite;
}

.vmup-hero-rocket .vmup-rocket-normal {
  animation: vmup-boost-flame-inv 7s infinite;
}

@keyframes vmup-boost-flame {
  0%, 57.99% { opacity: 0; }
  58%, 86.49% { opacity: 1; }
  86.5%, 100% { opacity: 0; }
}

@keyframes vmup-boost-flame-inv {
  0%, 57.99% { opacity: 1; }
  58%, 86.49% { opacity: 0; }
  86.5%, 100% { opacity: 1; }
}

@keyframes vmup-boost-shake {
  0%, 58% { transform: translate(0, 0); }
  59.5% { transform: translate(0.5px, -1.5px); }
  61% { transform: translate(2.5px, -1px); }
  62.5% { transform: translate(0.5px, -2.5px); }
  64% { transform: translate(2.5px, -2px); }
  65.5% { transform: translate(1px, -1px); }
  67% { transform: translate(2px, -2.5px); }
  68.5% { transform: translate(0.5px, -2.5px); }
  70% { transform: translate(2.5px, -1.5px); }
  72% { transform: translate(1px, -2px); }
  73.5%, 100% { transform: translate(0, 0); }
}

/* Hover overrides the timer: long flame and continuous shake for as long
   as the pointer stays on the rocket. :active gives touch a tap trigger. */
.vmup-hero-rocket:hover,
.vmup-hero-rocket:active {
  animation: vmup-boost-shake-hover 0.9s infinite;
}

.vmup-hero-rocket:hover .vmup-rocket-boost,
.vmup-hero-rocket:active .vmup-rocket-boost {
  animation: none;
  opacity: 1;
}

.vmup-hero-rocket:hover .vmup-rocket-normal,
.vmup-hero-rocket:active .vmup-rocket-normal {
  animation: none;
  opacity: 0;
}

@keyframes vmup-boost-shake-hover {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(0.5px, -1.5px); }
  20% { transform: translate(2.5px, -1px); }
  30% { transform: translate(0.5px, -2.5px); }
  40% { transform: translate(2.5px, -2px); }
  50% { transform: translate(1px, -1px); }
  60% { transform: translate(2px, -2.5px); }
  70% { transform: translate(0.5px, -2.5px); }
  80% { transform: translate(2.5px, -1.5px); }
  90% { transform: translate(1px, -2px); }
}

@media (prefers-reduced-motion: reduce) {
  /* No motion: timer loop and shakes off, short flame at rest. The hover
     flame swap (an opacity change, no movement) still works. */
  .vmup-hero-rocket,
  .vmup-hero-rocket:hover,
  .vmup-hero-rocket:active,
  .vmup-hero-rocket img {
    animation: none;
  }

  .vmup-hero-rocket .vmup-rocket-boost {
    opacity: 0;
  }

  .vmup-hero-rocket .vmup-rocket-normal {
    opacity: 1;
  }
}

@media screen and (max-width: 44rem) {
  .vmup-hero-rocket { width: 3rem; height: 3rem; }
  .vmup-hero-word { font-size: 2.2rem; }
}

.vmup-tagline {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--md-default-fg-color--light);
  margin: 0 auto 1.6rem;
  max-width: 38rem;
}

.vmup-install-tabs {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  max-width: 44rem;
  margin: 0 auto 0.5rem;
}

.vmup-install-tab {
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.8rem;
  border-radius: 0.4rem;
  font-family: var(--md-code-font-family);
  font-size: 0.62rem;
  background: transparent;
  color: var(--md-default-fg-color--light);
  transition: background 0.15s, color 0.15s;
}

.vmup-install-tab:hover {
  color: var(--md-default-fg-color);
}

.vmup-install-tab[aria-selected="true"] {
  background: #2a2a38;
  color: #fff;
}

.vmup-install {
  display: flex;
  align-items: stretch;
  justify-content: center;
  max-width: 44rem;
  margin: 0 auto 1.4rem;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--md-shadow-z1);
}

.vmup-install pre {
  flex: 1;
  margin: 0;
  padding: 0.9rem 1.1rem;
  text-align: left;
  font-family: var(--md-code-font-family);
  font-size: 0.62rem;
  line-height: 1.55;
  background: #1e1e28;
  color: #d8d8e4;
  overflow-x: auto;
  white-space: pre;
}

.vmup-copy {
  border: none;
  cursor: pointer;
  padding: 0 0.9rem;
  background: #2a2a38;
  color: #9a9ab0;
  transition: color 0.15s;
}

.vmup-copy:hover {
  color: #5cb8e6;
}

.vmup-copy.vmup-copied {
  color: #4ade80;
}

.vmup-cta .md-button {
  margin: 0.2rem 0.3rem;
}

.vmup-cta .md-button--primary {
  /* transparent border keeps the box the same size as the outlined button */
  border: 0.1rem solid transparent;
  background: linear-gradient(135deg, #542f83, #b53694);
}

.vmup-cta .md-button--primary:hover {
  background: linear-gradient(135deg, #6a3fa5, #d04bac);
}

[data-md-color-scheme="slate"] .vmup-cta .md-button--primary {
  background: linear-gradient(135deg, #6f6fd6, #5cb8e6);
}

[data-md-color-scheme="slate"] .vmup-cta .md-button--primary:hover {
  background: linear-gradient(135deg, #8a8ae0, #7ecbf0);
}

/* --- Homepage terminal placement --- */

.vmup-home .vmup-terminal {
  max-width: 46rem;
  margin: 0 auto 3.5rem;
  box-shadow: var(--md-shadow-z3);
}

.vmup-home .vmup-terminal .vmup-terminal-body {
  font-size: 0.6rem;
}

/* --- Feature grid --- */

.vmup-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}

.vmup-card {
  display: block;
  padding: 1.2rem 1.3rem;
  border-radius: 0.5rem;
  background: var(--md-code-bg-color);
  border: 1px solid transparent;
  color: var(--md-default-fg-color) !important;
  transition: border-color 0.15s, transform 0.15s;
}

.vmup-card:hover {
  border-color: var(--md-accent-fg-color);
  transform: translateY(-2px);
}

.vmup-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--md-typeset-a-color);
}

.vmup-card p {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.55;
  color: var(--md-default-fg-color--light);
}

@media screen and (max-width: 44rem) {
  .vmup-home { padding-top: 1.4rem; }
  .vmup-install pre { font-size: 0.55rem; }
}
