/* AlgoTree homepage — 5 sections, tabbed panels, 3D visuals */

.home-section {
  position: relative;
  isolation: isolate;
}

.home-tabs {
  margin-top: 2rem;
}

.home-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.home-tab {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.home-tab:hover {
  border-color: rgba(0, 229, 160, 0.35);
  color: var(--text);
}

.home-tab.active {
  background: linear-gradient(135deg, rgba(0, 229, 160, 0.18), rgba(34, 211, 238, 0.12));
  border-color: rgba(0, 229, 160, 0.45);
  color: var(--text);
}

.home-panel {
  display: none;
  animation: homeFade 0.35s ease;
}

.home-panel.active {
  display: block;
}

@keyframes homeFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: center;
}

/* Hero trading chart — visible, no 3D clip bugs */
.hero-future.home-section {
  overflow: visible;
}

/* Hero — premium side-by-side carousel (digital live feel) */
.hero-carousel-wrap {
  width: 100%;
  max-width: 560px;
  margin-left: auto;
}

.hero-carousel {
  position: relative;
}

.hero-carousel-viewport {
  overflow: hidden;
  border-radius: 22px;
  padding: 0.15rem;
  background: linear-gradient(135deg, rgba(0, 229, 160, 0.35), rgba(34, 211, 238, 0.2), rgba(167, 139, 250, 0.25));
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(0, 229, 160, 0.08);
}

.hero-carousel-track {
  display: flex;
  gap: 1.25rem;
  transition: transform 0.85s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.hero-carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
}

.hero-carousel-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: #060b16;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-carousel-frame-glow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(0, 229, 160, 0.08) 50%, transparent 70%);
  animation: heroShimmer 3.5s ease-in-out infinite;
  pointer-events: none;
  z-index: 2;
}

.hero-carousel-slide.is-active .hero-carousel-frame img {
  animation: heroKenBurns 8s ease-in-out infinite alternate;
}

.hero-carousel-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  transform-origin: center center;
}

.hero-carousel-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 229, 160, 0.06) 48%, transparent 52%, transparent 100%);
  background-size: 100% 220%;
  animation: heroScan 2.8s linear infinite;
  pointer-events: none;
  z-index: 3;
  mix-blend-mode: screen;
}

.hero-carousel-caption {
  margin-top: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

.hero-carousel-caption strong {
  color: var(--emerald);
  font-weight: 700;
}

.hero-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.hero-carousel-arrow {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
}

.hero-carousel-arrow:hover {
  border-color: rgba(0, 229, 160, 0.45);
  background: rgba(0, 229, 160, 0.1);
}

.hero-carousel-dots {
  display: flex;
  gap: 0.45rem;
}

.hero-carousel-dot {
  width: 2rem;
  height: 0.35rem;
  border-radius: 999px;
  border: none;
  background: rgba(148, 163, 184, 0.25);
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}

.hero-carousel-dot.active {
  width: 2.75rem;
  background: linear-gradient(90deg, var(--emerald), var(--cyan));
  box-shadow: 0 0 16px rgba(0, 229, 160, 0.35);
}

@keyframes heroKenBurns {
  from { transform: scale(1) translateY(0); }
  to { transform: scale(1.06) translateY(-1%); }
}

@keyframes heroScan {
  from { background-position: 0 -120%; }
  to { background-position: 0 220%; }
}

@keyframes heroShimmer {
  0%, 100% { opacity: 0.3; transform: translateX(-30%); }
  50% { opacity: 0.7; transform: translateX(30%); }
}

/* Live desk — full-width chart showcase */
.home-live-desk {
  background: linear-gradient(180deg, rgba(0, 229, 160, 0.03) 0%, transparent 100%);
}

.live-desk-showcase {
  max-width: 1100px;
  margin: 0 auto;
}

.live-desk-frame {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 160, 0.35);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05);
  background: #070d1a;
}

.live-desk-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  background: rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.live-desk-bar span:nth-child(1) { width: 10px; height: 10px; border-radius: 50%; background: #f87171; }
.live-desk-bar span:nth-child(2) { width: 10px; height: 10px; border-radius: 50%; background: #fbbf24; }
.live-desk-bar span:nth-child(3) { width: 10px; height: 10px; border-radius: 50%; background: #00e5a0; }

.live-desk-title {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.live-desk-frame > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center top;
}

.live-desk-badge {
  position: absolute;
  right: clamp(0.75rem, 2vw, 1.25rem);
  bottom: clamp(0.75rem, 2vw, 1.25rem);
  width: min(28%, 220px);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}

.live-desk-badge img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.hero-showcase {
  width: 100%;
  max-width: 520px;
  margin-left: auto;
}

.hero-showcase-frame {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(0, 229, 160, 0.4);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 48px rgba(0, 229, 160, 0.12);
  background: #0a1224;
  transform: perspective(1200px) rotateY(-5deg) rotateX(2deg);
  transition: transform 0.45s ease, box-shadow 0.45s ease;
}

.hero-showcase-frame:hover {
  transform: perspective(1200px) rotateY(-2deg) rotateX(0deg) translateY(-4px);
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 64px rgba(0, 229, 160, 0.18);
}

.hero-showcase-frame > img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 220px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center top;
  background: #0a1224;
}

.hero-showcase-badge {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  width: min(42%, 190px);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(167, 139, 250, 0.45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  background: #0b1020;
}

.hero-showcase-badge img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.home-visual-3d {
  perspective: 1200px;
  min-height: 280px;
}

.home-visual-stack {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(-8deg) rotateX(4deg);
  transition: transform 0.5s ease;
}

.home-visual-3d:hover .home-visual-stack {
  transform: rotateY(-4deg) rotateX(2deg) translateY(-4px);
}

.home-visual-card {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  background: rgba(8, 12, 24, 0.9);
}

.home-visual-card img,
.home-visual-card svg {
  display: block;
  width: 100%;
  height: auto;
  background: #0a1224;
}

.home-visual-photo img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center top;
  min-height: 200px;
}

.home-visual-card.back {
  position: absolute;
  inset: 0;
  transform: translateZ(-40px) translateX(18px) translateY(18px) scale(0.94);
  opacity: 0.55;
}

.home-visual-card.front {
  position: relative;
  transform: translateZ(24px);
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.home-feature {
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.home-feature h3 {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.home-feature p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.home-proof-list {
  display: grid;
  gap: 0.75rem;
}

.home-proof-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.home-proof-item strong {
  display: block;
  margin-bottom: 0.2rem;
}

.home-proof-item span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.home-start-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.home-start-card {
  padding: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  text-align: center;
}

.home-start-card h3 {
  font-size: 1.05rem;
  margin: 0.5rem 0;
}

.home-start-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.home-secure-note {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 229, 160, 0.25);
  background: rgba(0, 229, 160, 0.06);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 992px) {
  .home-split {
    grid-template-columns: 1fr;
  }
  .hero-carousel-wrap {
    order: -1;
    max-width: 100%;
    margin: 0 auto 0.75rem;
  }
  .live-desk-badge {
    width: min(38%, 180px);
  }
  .home-visual-3d {
    order: -1;
    max-width: 520px;
    margin: 0 auto;
  }
  .home-visual-stack {
    transform: none;
  }
  .home-start-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .home-feature-grid {
    grid-template-columns: 1fr;
  }
  .live-desk-badge {
    position: static;
    width: 100%;
    margin-top: 0.75rem;
    border-radius: 12px;
  }
  .live-desk-frame {
    display: flex;
    flex-direction: column;
  }
  .home-tablist {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }
  .home-tab {
    flex: 0 0 auto;
  }
}

@media (max-width: 768px) {
  .ai-guide-root {
    bottom: 5.5rem;
  }
}
