/* Miss Marigold on the landing page, for a signed-out visitor (visitor.js).
   Her figure, and her speech bubble always beside her (under her on phones).
   The bubble keeps one size in every state; a long answer scrolls inside. */

.visitor-marigold {
  --vm-bubble-w: 470px;
  --vm-bubble-h: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  width: min(760px, 100%);
  margin: 1.6rem auto 0;
  text-align: left;
  animation: vm-in 420ms ease-out both;
}

.visitor-marigold[hidden],
.visitor-marigold [hidden] {
  display: none !important;
}
@keyframes vm-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.vm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- her figure: the button that opens her choices */

.vm-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex: none;
}

.vm-figure {
  position: relative;
  width: 230px;
  height: 300px;
  padding: 0;
  border: 0;
  border-radius: 40% 40% 28px 28px / 30% 30% 28px 28px;
  background: none;
  cursor: pointer;
  transition: transform 220ms ease;
  -webkit-tap-highlight-color: transparent;
}

.vm-figure:hover {
  transform: translateY(-3px);
}

.vm-figure:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* A soft light behind her and a pool of light at her feet. Both fade to
   nothing inside their own box (closest-side), so no edge is ever drawn. */
.vm-halo,
.vm-ground {
  position: absolute;
  left: 50%;
  pointer-events: none;
  transform: translateX(-50%);
}

.vm-halo {
  top: 6%;
  width: 92%;
  height: 84%;
  background: radial-gradient(closest-side, rgba(255, 214, 120, 0.24), rgba(255, 214, 120, 0.08) 60%, transparent);
  opacity: 0.7;
  transition: opacity 300ms ease;
}

.vm-ground {
  bottom: 2px;
  width: 74%;
  height: 40px;
  background:
    radial-gradient(closest-side, rgba(7, 13, 36, 0.55), rgba(7, 13, 36, 0.18) 55%, transparent) center 60% / 62% 46% no-repeat,
    radial-gradient(closest-side, rgba(255, 214, 120, 0.42), rgba(255, 214, 120, 0.14) 55%, transparent);
}

.vm-figure:hover .vm-halo,
.visitor-marigold.is-speaking .vm-halo {
  opacity: 1;
}

/* Her feet stand at the canvas foot (head.js leaves 4 cm under them), which
   sits on the centre of the ground glow. */
.vm-canvas {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 20px;
  width: 100%;
  height: calc(100% - 20px);
  opacity: 0;
  transition: opacity 400ms ease;
  pointer-events: none;
}

.visitor-marigold.is-live .vm-canvas { opacity: 1; }

/* Only when her 3D figure cannot load at all (no WebGL). */
.vm-portrait {
  position: absolute;
  top: 10%;
  left: 50%;
  width: 62%;
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  object-fit: cover;
  transform: translateX(-50%);
}

/* ---- Say hello: in the bubble, when her welcome could not start */

.vm-invite {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.95rem 0.32rem 0.34rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gold-soft);
  background: linear-gradient(135deg, rgba(255, 229, 150, 0.16), rgba(88, 179, 104, 0.14)), rgba(10, 18, 48, 0.85);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  animation: vm-invite-in 360ms ease-out both;
  transition: border-color 160ms ease, transform 160ms ease;
}

.vm-invite:hover,
.vm-invite:focus-visible {
  border-color: var(--gold);
  transform: translateY(-1px);
  outline: none;
}

.vm-invite:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 229, 150, 0.45), 0 6px 18px rgba(0, 0, 0, 0.3);
}

.vm-invite-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-800);
}

.vm-spark {
  animation: vm-twinkle 2.2s ease-in-out infinite;
}

.vm-spark-2 {
  animation-delay: 1.1s;
}

@keyframes vm-invite-in {
  from { opacity: 0; transform: translateY(4px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes vm-twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ---- her speech bubble: always there, always this size */

.vm-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 1 var(--vm-bubble-w);
  min-width: 0;
  height: var(--vm-bubble-h);
  padding: 0.8rem 0.4rem 0.6rem 1.15rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gold-soft);
  background: rgba(10, 18, 48, 0.92);
  box-shadow: var(--shadow-card);
  transition: border-color 200ms ease;
}

.vm-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-soft) transparent;
}

.vm-view {
  animation: vm-fade 220ms ease-out both;
}

@keyframes vm-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Waiting, and Say hello: centred in the same space the options fill. */
.vm-wait,
.vm-hello {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  height: 100%;
}

.vm-wait {
  flex-direction: row;
  gap: 0.45rem;
}

.vm-wait span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.35;
  animation: vm-dot 1.2s ease-in-out infinite;
}

.vm-wait span:nth-child(2) { animation-delay: 0.18s; }
.vm-wait span:nth-child(3) { animation-delay: 0.36s; }

@keyframes vm-dot {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}

.vm-invite[aria-busy="true"] .vm-invite-icon {
  animation: vm-dot 1.2s ease-in-out infinite;
}

.vm-panel::before {
  content: "";
  position: absolute;
  left: -9px;
  top: 42%;
  width: 16px;
  height: 16px;
  transform: rotate(45deg);
  background: rgba(10, 18, 48, 0.92);
  border-left: 1px solid var(--gold-soft);
  border-bottom: 1px solid var(--gold-soft);
}

.visitor-marigold.is-speaking .vm-panel {
  border-color: var(--gold);
}

.vm-panel-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.vm-name {
  margin: 0 auto 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.vm-sound {
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-faint);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.vm-sound:hover,
.vm-sound:focus-visible {
  color: var(--ink);
  border-color: var(--gold-soft);
  outline: none;
}

.vm-prompt {
  margin: 0 0 0.7rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.vm-menu {
  display: grid;
  gap: 0.5rem;
}

.vm-choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 46px;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gold-soft);
  background: var(--gold-faint);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.vm-choice:hover,
.vm-choice:focus-visible {
  border-color: var(--gold);
  background: rgba(255, 229, 150, 0.2);
  outline: none;
}

.vm-choice-emoji {
  font-size: 1.25rem;
}

/* ---- an answer: pictures, numbers and buttons; she says the rest */

.vm-answer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 100%;
}

.vm-answer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.vm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 30px;
}

.vm-back {
  padding: 0.2rem 0.1rem;
  border: 0;
  background: none;
  color: var(--ink-faint);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.vm-back:hover,
.vm-back:focus-visible {
  color: var(--gold);
  outline: none;
  text-decoration: underline;
}

.vm-cta-mini {
  padding: 0.32rem 0.8rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #ffe08a, #f5b73b);
  color: #2a1a00;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(245, 183, 59, 0.28);
}

.vm-link-mini {
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.vm-cta-mini:hover,
.vm-cta-mini:focus-visible {
  filter: brightness(1.06);
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.vm-link-mini:hover,
.vm-link-mini:focus-visible {
  color: var(--gold);
}

.vm-nowrap {
  white-space: nowrap;
}

/* About: the four ways to learn, in their own art. */
.vm-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.vm-gallery li {
  position: relative;
  aspect-ratio: 2.7;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--gold-soft);
  background: rgba(255, 229, 150, 0.08);
}

.vm-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.vm-gallery li > span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 0.55rem 0.28rem;
  background: linear-gradient(transparent, rgba(7, 13, 36, 0.86));
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.vm-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.3rem 0.6rem;
  margin-top: auto !important;
  padding-top: 0.45rem !important;
  border-top: 1px solid var(--gold-soft);
}

.vm-strip li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.vm-strip-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold-faint);
  color: var(--gold);
}

.vm-strip-icon svg {
  width: 15px;
  height: 15px;
}

/* Cost: the free trial, then two plans. */
.vm-trial {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.vm-free {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.3rem 0.85rem 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #7fdc8f, #3fae5b);
  color: #06260f;
  box-shadow: 0 3px 14px rgba(88, 179, 104, 0.35);
  transform: rotate(-2deg);
}

.vm-free strong {
  font-size: 1.7rem;
  line-height: 1;
}

.vm-free span {
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vm-ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.75rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 700;
}

.vm-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.vm-plan {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 0.65rem;
  padding: 0.85rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gold-soft);
  background: linear-gradient(160deg, rgba(255, 229, 150, 0.14), rgba(255, 229, 150, 0.04));
}

.vm-plan-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 229, 150, 0.16);
  color: var(--gold);
}

.vm-plan-icon svg {
  width: 30px;
  height: 30px;
}

.vm-plan-who {
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.vm-plan-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 0.3rem;
}

.vm-plan-price strong {
  color: var(--gold);
  font-size: 1.8rem;
  line-height: 1.1;
}

.vm-plan-price span {
  color: var(--ink-faint);
  font-size: 0.75rem;
}

.vm-plan-price b {
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vm-cta {
  margin-top: auto;
  width: 100%;
  text-align: center;
}

/* ---- phones: she comes straight after the headline, so she is on the
   first screen; her bubble sits under her at full width. */

@media (max-width: 640px) {
  .visitor-marigold {
    --vm-bubble-h: 272px;
  }

  .hero-inner > .hero-logo {
    order: -3;
    width: min(240px, 64vw);
    margin-bottom: 1rem;
  }

  .hero-inner > h1 {
    order: -2;
  }

  .visitor-marigold {
    order: -1;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0 auto 1.4rem;
  }

  .vm-figure {
    width: 164px;
    height: 214px;
  }

  .vm-canvas {
    bottom: 16px;
    height: calc(100% - 16px);
  }

  .vm-ground {
    height: 32px;
  }

  .vm-panel {
    flex: none;
    width: 100%;
  }

  .vm-panel::before {
    left: 50%;
    top: -9px;
    transform: translateX(-50%) rotate(135deg);
  }

  .vm-answer {
    gap: 0.4rem;
  }

  .vm-bar {
    min-height: 28px;
  }

  .vm-gallery li {
    aspect-ratio: 2.8;
  }

  .vm-strip {
    justify-content: flex-start;
    gap: 0.25rem 0.6rem;
    padding-top: 0.35rem !important;
  }

  .vm-strip li {
    font-size: 0.74rem;
  }

  .vm-strip-icon {
    width: 21px;
    height: 21px;
  }

  .vm-plan {
    padding: 0.5rem 0.5rem;
    column-gap: 0.4rem;
  }

  .vm-plan-price strong {
    font-size: 1.45rem;
  }

  .vm-plan-icon {
    width: 32px;
    height: 32px;
  }

  .vm-plan-icon svg {
    width: 21px;
    height: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .visitor-marigold,
  .vm-invite,
  .vm-view,
  .vm-wait span,
  .vm-invite-icon,
  .vm-spark {
    animation: none !important;
  }

  .vm-figure:hover {
    transform: none;
  }
}
