/* Landing layout with sidebar — Beyond Mutual Fund */

.landing-page .app-shell {
  min-height: 100vh;
  height: auto;
  max-height: none;
  overflow: visible;
}

.landing-page .app-body--landing {
  padding: 0 0.75rem 0;
  overflow-x: hidden;
  overflow-y: visible;
  flex: 1;
  min-height: 100vh;
  max-height: none;
}

.landing-page #chat {
  scroll-margin-top: 1rem;
}

.landing-page .landing-hero,
.landing-page .landing-section {
  scroll-margin-top: 4.5rem;
}

.landing-page .landing-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 64rem;
  margin: 0 auto;
  padding: 0 0 2rem;
}

/* Hero + chat */
.landing-hero {
  display: grid;
  grid-template-columns: minmax(12rem, 0.95fr) minmax(16rem, 1.25fr);
  gap: 1.5rem 2.5rem;
  align-items: center;
  padding: clamp(1.5rem, 4vw, 2.75rem) 0 clamp(2rem, 4vw, 2.75rem);
  text-align: left;
}

.landing-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4.5vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 0.55rem;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.landing-hero-sub {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--text-muted);
  max-width: 28rem;
  margin: 0;
}

.hero-copy {
  min-width: 0;
}

.landing-chat-panel {
  max-width: 44rem;
  margin: 0 auto;
  text-align: left;
}

.landing-chat-panel .chat-container {
  max-width: none;
}

.landing-chat-panel .chat-messages:not(.chat-messages--empty) {
  max-height: min(42vh, 420px);
}

.landing-chat-panel .chat-input {
  min-height: 3.25rem;
}

/* Full-height wide chat (same behavior as main .main--chat-active from PR #2/#4) */
.landing-page .app-shell:has(.main--chat-active) {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

.landing-page .app-body--landing:has(.main--chat-active) {
  overflow: hidden;
  max-height: 100vh;
  max-height: 100dvh;
}

.landing-page .main.landing-main.main--chat-active {
  max-width: none;
  margin: 0;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0;
}

.landing-page .main--chat-active .landing-hero-title,
.landing-page .main--chat-active .landing-hero-sub,
.landing-page .main--chat-active .howto-hero-cta,
.landing-page .main--chat-active .hero-ctas,
.landing-page .main--chat-active .market-stats {
  display: none;
}

.landing-page .main--chat-active > .landing-hero {
  display: none;
}

.landing-page .main--chat-active > .landing-section:not(#ask-ai) {
  display: none;
}

.landing-page .main--chat-active #ask-ai {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  border-top: none;
  padding-top: 0.35rem;
}

.landing-page .main--chat-active #ask-ai .ask-ai-head {
  display: none;
}

.landing-page .main--chat-active .landing-chat-panel {
  max-width: none;
  margin: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.landing-page .main--chat-active .landing-chat-panel .chat-messages:not(.chat-messages--empty) {
  max-height: none;
}

.landing-page .main--chat-active .chat-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: none;
  padding: 0 1rem 0.75rem;
}

.landing-page .main--chat-active .chat-promo-pill {
  display: none;
}

.landing-page .main--chat-active .chat-messages {
  flex: 1;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
}

.landing-page .main--chat-active .chat-form {
  flex-shrink: 0;
}

.landing-page .main--chat-active .message {
  max-width: min(90%, 42rem);
}

/* Sections */
.landing-section {
  padding: clamp(1.75rem, 3.5vw, 2.5rem) 0;
  border-top: 1px solid var(--border);
}

.landing-main > .ask-ai-section:first-child {
  border-top: none;
  padding-top: clamp(1rem, 3vw, 1.75rem);
}

.landing-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.landing-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.8vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.landing-section-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  max-width: 32rem;
}

.landing-section-sub--lead {
  margin-bottom: 1.25rem;
}

.landing-section-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}

.top-funds-carousel {
  margin-bottom: 0;
}

.top-funds-carousel .carousel-track {
  padding-left: 2.85rem;
  padding-right: 2.85rem;
  scroll-padding-inline: 2.85rem;
  -webkit-mask-image: linear-gradient(90deg, #000 2.85rem, #000 calc(100% - 2.85rem), transparent);
  mask-image: linear-gradient(90deg, #000 2.85rem, #000 calc(100% - 2.85rem), transparent);
}

.top-funds-carousel .carousel-prev {
  left: 0.5rem;
}

.top-funds-carousel .carousel-next {
  right: 0.5rem;
}

.top-fund-card {
  position: relative;
  flex: 0 0 220px;
  display: block;
  width: 220px;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.top-fund-card:focus-visible {
  outline: 2px solid var(--accent-violet);
  outline-offset: 2px;
}

.top-fund-rank {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  min-width: 1.65rem;
  height: 1.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: #0a0a0f;
  background: var(--gradient-brand);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

.top-fund-card .card-title {
  padding-left: 2.1rem;
  min-height: 2.5rem;
}

.top-fund-card .card-desc {
  font-size: 0.78rem;
}

.top-fund-card .return-value {
  padding-left: 0.65rem;
}

/* Platform highlights */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.highlight-card {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.35rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(165deg, rgba(168, 85, 247, 0.08) 0%, var(--bg-card) 50%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s, transform 0.2s;
}

.highlight-card[data-chat-prompt],
a.highlight-card--link {
  cursor: pointer;
}

a.highlight-card--link {
  text-decoration: none;
  color: inherit;
}

@media (hover: hover) and (pointer: fine) {
  .highlight-card:hover {
    border-color: rgba(168, 85, 247, 0.35);
    transform: translateY(-2px);
  }
}

.highlight-card--soon {
  opacity: 0.72;
  background: var(--bg-card);
}

.highlight-card--soon:hover {
  transform: none;
  border-color: var(--border-strong);
}

.highlight-icon {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.25rem;
  background: rgba(168, 85, 247, 0.15);
}

.highlight-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.highlight-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

.highlight-cta {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.35rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #0a0a0f;
  background: var(--gradient-brand);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.highlight-cta:hover {
  filter: brightness(1.06);
}

.highlight-soon-badge {
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
}

/* App coming soon */
.app-coming-section {
  border-top: 1px solid var(--border);
  padding-bottom: 2.5rem;
}

.app-coming-banner {
  text-align: center;
  padding: clamp(2rem, 5vw, 3rem) 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(168, 85, 247, 0.35);
  background: linear-gradient(165deg, rgba(168, 85, 247, 0.1) 0%, rgba(34, 211, 238, 0.05) 50%, var(--bg-card) 100%);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.28);
}

.app-coming-badge {
  display: inline-block;
  margin-bottom: 0.85rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0a0a0f;
  background: var(--gradient-brand);
}

.app-coming-banner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.app-coming-banner p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 28rem;
  margin: 0 auto;
  line-height: 1.55;
}

/* How to use this AI — intro player */
.hero-ctas {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.howto-hero-cta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 0.65rem;
  margin: 0;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(168, 85, 247, 0.1);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.howto-dialog {
  width: min(52rem, calc(100vw - 1.5rem));
  max-height: calc(100dvh - 1.5rem);
  margin: auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.howto-dialog::backdrop {
  background: rgba(5, 5, 8, 0.72);
}

.howto-dialog-panel {
  position: relative;
  max-height: calc(100dvh - 1.5rem);
  overflow: auto;
  padding: 1.35rem 1.25rem 1.5rem;
}

.howto-dialog-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  margin: 0 0 0.35rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.howto-hero-cta:hover {
  border-color: rgba(168, 85, 247, 0.45);
  background: rgba(168, 85, 247, 0.16);
}

.howto-hero-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #0a0a0f;
  font-size: 0.65rem;
  padding-left: 0.12rem;
}

.howto-hero-meta {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.stats-ask-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
}

.stats-ask-cta:hover {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.1);
}

.market-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 1.35rem 2rem;
  margin: 0;
  min-width: 0;
  text-align: left;
}

.market-stat {
  padding: 0;
  border: none;
  background: none;
  min-width: 0;
}

.market-stat-value {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.2vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 0.3rem;
}

.market-stat-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0;
}

.howto-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: #09090f;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.howto-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.9) brightness(0.55);
  transform: scale(1.04);
}

.howto-player--playing .howto-video {
  filter: none;
}

.howto-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.15rem 1.2rem 1.35rem;
  background: linear-gradient(180deg, rgba(5, 5, 8, 0.15) 0%, rgba(5, 5, 8, 0.55) 48%, rgba(5, 5, 8, 0.88) 100%);
  cursor: pointer;
}

.howto-player--playing .howto-overlay {
  background: linear-gradient(180deg, rgba(5, 5, 8, 0) 0%, rgba(5, 5, 8, 0) 46%, rgba(5, 5, 8, 0.55) 72%, rgba(5, 5, 8, 0.82) 100%);
}

.howto-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -70%);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem 0.7rem 0.75rem;
  border: none;
  border-radius: 999px;
  background: var(--gradient-brand);
  color: #0a0a0f;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 32px rgba(168, 85, 247, 0.4);
}

.howto-player--playing .howto-play {
  opacity: 0;
  pointer-events: none;
}

.howto-error {
  margin: 0 0 0.75rem;
  color: #ffb4b4;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.45;
}

.howto-player--ended .howto-play,
.howto-player:not(.howto-player--playing) .howto-play {
  opacity: 1;
  pointer-events: auto;
}

.howto-player.howto-player--error .howto-play {
  opacity: 0;
  pointer-events: none;
}

.howto-play-icon {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(10, 10, 15, 0.18);
  font-size: 0.8rem;
  padding-left: 0.12rem;
}

.howto-caption {
  max-width: 38rem;
  text-align: left;
  pointer-events: none;
}

.howto-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 0.3rem;
}

.howto-caption-title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  font-weight: 650;
  color: #fff;
  margin-bottom: 0.4rem;
  letter-spacing: -0.02em;
}

.howto-caption-body {
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(244, 244, 248, 0.9);
}

.howto-sample[hidden] {
  display: none !important;
}

.howto-sample {
  pointer-events: auto;
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.45rem 0.75rem;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #f4f4f8;
  font-family: inherit;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}

.howto-sample:hover {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(168, 85, 247, 0.16);
}

.howto-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 4;
}

.howto-progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gradient-brand);
}

.howto-steps {
  list-style: none;
  margin: 1.15rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.howto-steps li {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.95rem 0.95rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.howto-steps li.is-active {
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.18);
}

.howto-steps strong {
  font-family: var(--font-display);
  font-size: 0.95rem;
}

.howto-steps span {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
}

.howto-try-btn {
  align-self: flex-start;
  margin-top: 0.25rem;
  padding: 0.4rem 0.7rem;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0a0a0f;
  background: var(--gradient-brand);
  cursor: pointer;
}

.howto-disclaimer {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (max-width: 1023px) {
  .howto-steps {
    grid-template-columns: 1fr;
  }

  .landing-page .app-body--landing {
    padding: 0 0.7rem 0;
  }

  .landing-page .main--chat-active .chat-container {
    padding: 0 0.35rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }

  .highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .highlight-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767px) {
  .landing-page .app-body--landing {
    padding: 0 0.5rem 0;
  }

  .landing-hero {
    grid-template-columns: 1fr;
    text-align: left;
    padding: 1.15rem 0 1.6rem;
  }

  .landing-chat-panel .chat-input {
    min-height: 3.4rem;
  }

  .highlight-grid {
    grid-template-columns: 1fr;
  }

  .highlight-grid > :last-child:nth-child(odd) {
    grid-column: auto;
  }

  .top-funds-carousel .carousel-track {
    padding-left: 2.4rem;
    padding-right: 2.4rem;
    scroll-padding-inline: 2.4rem;
  }

  .top-fund-card,
  .card {
    flex-basis: 200px;
    width: 200px;
  }

  .app-coming-banner {
    padding: 1.6rem 1rem;
  }

  .market-stats {
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem 1.25rem;
  }

  .market-stat-value {
    font-size: 1.25rem;
  }

  .howto-player {
    aspect-ratio: 4 / 5;
  }

  .howto-overlay {
    padding: 0.9rem 0.9rem 1.1rem;
  }

  .howto-play {
    transform: translate(-50%, -90%);
    padding: 0.55rem 0.95rem 0.55rem 0.6rem;
    font-size: 0.85rem;
  }

  .howto-caption-body {
    font-size: 0.85rem;
  }
}
