/* TradeCore — главная страница (премиум-полировка) */

body.page-home {
  --home-glow: rgba(91, 141, 239, 0.14);
}

body.page-home .main {
  position: relative;
}

/* —— Hero —— */
.home-hero {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 0 28px;
  text-align: center;
  overflow: hidden;
}

.home-hero__glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 280px;
  pointer-events: none;
  background:
    radial-gradient(ellipse 55% 80% at 50% 0%, rgba(91, 141, 239, 0.22), transparent 65%),
    radial-gradient(ellipse 40% 60% at 85% 30%, rgba(167, 139, 250, 0.12), transparent 70%),
    radial-gradient(ellipse 35% 50% at 10% 40%, rgba(91, 141, 239, 0.08), transparent 70%);
  z-index: 0;
  animation: home-hero-glow-drift 10s ease-in-out infinite;
}

@keyframes home-hero-glow-drift {
  0%, 100% {
    opacity: 0.85;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateY(8px) scale(1.04);
  }
}

.home-hero__inner {
  position: relative;
  z-index: 1;
}

.home-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  margin-bottom: 18px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tc-alpha, #a78bfa);
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.32);
  box-shadow: 0 0 24px rgba(167, 139, 250, 0.12);
}

.home-hero__badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tc-alpha);
  box-shadow: 0 0 10px var(--tc-alpha);
  animation: home-pulse 2.4s ease-in-out infinite;
}

@keyframes home-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.85); }
}

body.page-home .hero-header.home-hero .hero-title {
  margin-bottom: 14px;
}

/* Hero text — staggered entrance */
body.page-home .home-hero .home-hero__badge,
body.page-home .home-hero .hero-line,
body.page-home .home-hero .home-hero__actions {
  opacity: 0;
}

body.page-home .home-hero .hero-lines {
  display: block;
}

body.page-home .home-hero .hero-line {
  display: block;
  overflow: hidden;
}

body.page-home .home-hero .hero-line__text {
  display: inline-block;
}

body.page-home .home-hero.is-visible .home-hero__badge {
  animation: home-hero-badge-in 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.page-home .home-hero.is-visible .hero-title .hero-line {
  animation: home-hero-line-in 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.18s + var(--hero-line-i, 0) * 0.14s);
}

body.page-home .home-hero.is-visible .hero-title .hero-line__text {
  background: linear-gradient(
    105deg,
    #f2f6ff 0%,
    #d4e0ff 22%,
    #16d985 48%,
    #5b8def 72%,
    #f2f6ff 100%
  );
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: home-hero-title-shimmer 7s ease-in-out 1.1s infinite;
}

body.page-home .home-hero.is-visible .hero-subtitle .hero-line {
  animation: home-hero-line-in 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.42s + var(--hero-line-i, 0) * 0.1s);
}

body.page-home .home-hero.is-visible .home-hero__actions {
  animation: home-hero-actions-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: 0.72s;
}

body.page-home .home-hero.is-visible .home-hero__link {
  animation: home-hero-link-glow 2.8s ease-in-out 1.2s infinite;
}

@keyframes home-hero-badge-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes home-hero-line-in {
  from {
    opacity: 0;
    transform: translateY(1.15em);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes home-hero-title-shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

@keyframes home-hero-actions-in {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes home-hero-link-glow {
  0%, 100% { text-shadow: none; }
  50% { text-shadow: 0 0 20px rgba(126, 179, 255, 0.45); }
}

/* Trust strip — stagger after hero */
body.page-home .home-trust .home-trust__item {
  opacity: 0;
}

body.page-home .home-trust.is-visible .home-trust__item {
  animation: home-trust-item-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.08s + var(--trust-i, 0) * 0.07s);
}

@keyframes home-trust-item-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.page-home .hero-subtitle {
  font-size: 1.05rem !important;
  line-height: 1.65 !important;
  max-width: 34rem;
}

body.page-home .hero-subtitle strong {
  color: var(--tc-alpha, #a78bfa);
  font-weight: 700;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  margin-top: 26px;
}

.home-hero__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--tc-accent-bright, #7eb3ff);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  transition: color 0.2s, gap 0.2s;
}

.home-hero__link:hover {
  color: #fff;
  gap: 10px;
}

/* —— Trust strip —— */
.home-trust {
  max-width: 1120px;
  margin: 0 auto 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.home-trust__item {
  background: var(--tc-bg-card, rgba(18, 22, 31, 0.92));
  border: 1px solid var(--tc-border, rgba(255, 255, 255, 0.07));
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.home-trust__item:hover {
  border-color: rgba(91, 141, 239, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(91, 141, 239, 0.1);
}

.home-trust__value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 4px;
  background: linear-gradient(180deg, #fff 30%, #a8b4c8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-trust__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--tc-text-muted, #9ca3af);
  line-height: 1.35;
}

/* —— Content cards —— */
body.page-home .content-layout {
  gap: 20px !important;
}

body.page-home .trader-card {
  position: relative;
  overflow: hidden;
}

body.page-home .trader-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--tc-accent), var(--tc-alpha));
  opacity: 0.85;
  pointer-events: none;
}

body.page-home .trader-metrics {
  border-top-color: var(--tc-border) !important;
}

body.page-home .metric-item {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--tc-border) !important;
  border-radius: 12px !important;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

body.page-home .metric-item:hover {
  border-color: rgba(91, 141, 239, 0.35) !important;
  box-shadow: 0 6px 20px rgba(91, 141, 239, 0.1);
  transform: translateY(-1px);
}

body.page-home .metric-label {
  color: var(--tc-text-muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}

body.page-home .metric-value {
  color: var(--tc-text) !important;
  font-variant-numeric: tabular-nums;
}

body.page-home .performance-section {
  position: relative;
}

.home-perf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 0;
  margin-bottom: 4px;
}

.home-perf-head__title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0;
}

.home-perf-head__live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--tc-profit, #22c55e);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.home-perf-head__live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tc-profit);
  animation: home-pulse 1.8s ease-in-out infinite;
}

body.page-home .stats-grid {
  padding: 0 16px 8px;
}

body.page-home .trades-progress {
  margin: 8px 16px 16px;
}

body.page-home .progress-bar {
  background: rgba(255, 255, 255, 0.06) !important;
  border-radius: 999px;
  overflow: hidden;
  height: 8px !important;
}

/* —— Footer & banner —— */
body.page-home .footer-info {
  max-width: 1120px;
  margin: 0 auto;
  padding-top: 32px;
}

/* registration-banner: fixed — see tradecore-v2.css */

body.page-home .banner-btn {
  position: relative;
  overflow: hidden;
}

body.page-home .banner-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.2) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform 0.5s ease;
}

body.page-home .banner-btn:hover::after {
  transform: translateX(120%);
}

/* —— Reveal animation —— */
.home-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.home-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .home-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .home-hero__badge::before,
  .home-perf-head__live::before,
  .home-hero__glow {
    animation: none;
  }

  body.page-home .home-hero .home-hero__badge,
  body.page-home .home-hero .hero-line,
  body.page-home .home-hero .home-hero__actions,
  body.page-home .home-trust .home-trust__item {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
    filter: none !important;
  }

  body.page-home .home-hero .hero-title .hero-line__text {
    -webkit-text-fill-color: inherit;
    color: inherit;
    background: none;
  }
}

/* —— Mobile —— */
@media (max-width: 768px) {
  body.page-home .home-hero {
    padding: 0 0 18px;
  }

  .home-hero__actions {
    flex-direction: column;
    width: 100%;
  }

  .home-trust {
    grid-template-columns: repeat(2, 1fr);
    margin: 0 12px 20px;
    gap: 10px;
  }

  .home-trust__value {
    font-size: 1.15rem;
  }

  .home-perf-head {
    padding: 16px 16px 0;
  }

  body.page-home .footer-info {
    padding-bottom: 24px;
  }
}

/* Mobile charts & blocks */
@media (max-width: 768px) {
  body.page-home .mobile-chart-block,
  body.page-home .mobile-histogram-block,
  body.page-home .mobile-piechart-block {
    margin: 12px 16px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--tc-border);
  }

  body.page-home .mobile-profit-chart {
    position: relative;
    overflow: hidden;
    padding: 18px 16px 14px;
    background: linear-gradient(165deg, rgba(22, 217, 133, 0.06) 0%, rgba(255, 255, 255, 0.02) 42%, rgba(56, 189, 248, 0.04) 100%);
    border-color: rgba(34, 197, 94, 0.18);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.04) inset,
      0 12px 40px rgba(0, 0, 0, 0.35);
  }

  body.page-home .mobile-profit-chart::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(34, 197, 94, 0.12), transparent 60%);
    pointer-events: none;
  }

  body.page-home .mobile-chart-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 10px;
  }

  body.page-home .mobile-chart-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.28);
  }

  body.page-home .mobile-chart-live__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
    animation: mobile-chart-pulse 2s ease-in-out infinite;
  }

  @keyframes mobile-chart-pulse {
    0%,
    100% {
      opacity: 1;
      transform: scale(1);
    }
    50% {
      opacity: 0.55;
      transform: scale(0.85);
    }
  }

  body.page-home .mobile-chart-canvas-wrap {
    position: relative;
    z-index: 1;
    height: 200px;
    margin: 0 -4px;
    border-radius: 12px;
    background: rgba(8, 12, 18, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 4px 4px;
  }

  body.page-home .mobile-chart-canvas-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
  }

  body.page-home .mobile-chart-legend {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  body.page-home .mobile-chart-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(203, 213, 225, 0.9);
  }

  body.page-home .mobile-profit-chart .legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
  }

  body.page-home .mobile-profit-chart .legend-profit {
    background: #22c55e;
    color: #22c55e;
  }

  body.page-home .mobile-profit-chart .legend-roi {
    background: #38bdf8;
    color: #38bdf8;
  }

  body.page-home .mobile-profit-histogram {
    position: relative;
    overflow: hidden;
    padding: 18px 16px 14px;
    background: linear-gradient(165deg, rgba(34, 197, 94, 0.07) 0%, rgba(255, 255, 255, 0.02) 50%, rgba(12, 18, 28, 0.4) 100%);
    border-color: rgba(34, 197, 94, 0.16);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.04) inset,
      0 10px 36px rgba(0, 0, 0, 0.32);
  }

  body.page-home .mobile-profit-histogram::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 45% at 100% 0%, rgba(34, 197, 94, 0.1), transparent 55%);
    pointer-events: none;
  }

  body.page-home .mobile-histogram-header {
    position: relative;
    z-index: 1;
    margin-bottom: 10px;
  }

  body.page-home .mobile-histogram-title {
    font-weight: 700;
    font-size: 16px;
    color: #fff;
  }

  body.page-home .mobile-histogram-summary {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(8, 12, 18, 0.5);
    border: 1px solid rgba(34, 197, 94, 0.12);
  }

  body.page-home .mobile-histogram-summary__label {
    font-size: 12px;
    color: rgba(148, 163, 184, 0.9);
  }

  body.page-home .mobile-histogram-summary__value {
    font-size: 18px;
    font-weight: 700;
    color: #4ade80;
    letter-spacing: -0.02em;
    text-shadow: 0 0 20px rgba(74, 222, 128, 0.35);
  }

  body.page-home .mobile-histogram-canvas-wrap {
    height: 168px;
  }

  body.page-home .mobile-strategy-pie {
    position: relative;
    overflow: hidden;
    padding: 18px 16px 14px;
    background: linear-gradient(
      155deg,
      rgba(167, 139, 250, 0.08) 0%,
      rgba(255, 255, 255, 0.02) 45%,
      rgba(34, 197, 94, 0.05) 100%
    );
    border-color: rgba(167, 139, 250, 0.2);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.04) inset,
      0 10px 36px rgba(0, 0, 0, 0.32);
  }

  body.page-home .mobile-strategy-pie::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 40% at 20% 0%, rgba(167, 139, 250, 0.12), transparent 60%);
    pointer-events: none;
  }

  body.page-home .mobile-piechart-header {
    position: relative;
    z-index: 1;
    margin-bottom: 10px;
  }

  body.page-home .mobile-pie-meta {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
  }

  body.page-home .mobile-pie-meta__item {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(8, 12, 18, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  body.page-home .mobile-pie-meta__label {
    display: block;
    font-size: 11px;
    color: rgba(148, 163, 184, 0.85);
    margin-bottom: 2px;
  }

  body.page-home .mobile-pie-meta__value {
    font-size: 16px;
    font-weight: 700;
    color: #f1f5f9;
  }

  body.page-home .mobile-pie-meta__value--green {
    color: #4ade80;
  }

  body.page-home .mobile-pie-canvas-wrap {
    position: relative;
    height: 200px;
    margin-bottom: 4px;
  }

  body.page-home .mobile-pie-canvas-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    border: 1px solid rgba(34, 197, 94, 0.12);
    pointer-events: none;
    animation: pie-ring-pulse 3.5s ease-in-out infinite;
  }

  @keyframes pie-ring-pulse {
    0%,
    100% {
      opacity: 0.35;
      box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
    50% {
      opacity: 1;
      box-shadow: 0 0 24px 2px rgba(34, 197, 94, 0.08);
    }
  }

  body.page-home .mobile-strategy-pie.is-revealed .mobile-pie-meta__item {
    animation: pie-meta-in 0.55s ease-out both;
  }

  body.page-home .mobile-strategy-pie.is-revealed .mobile-pie-meta__item:nth-child(2) {
    animation-delay: 0.08s;
  }

  @keyframes pie-meta-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  body.page-home .mobile-strategy-pie.is-revealed .mobile-pie-canvas-wrap {
    animation: pie-chart-in 0.7s ease-out 0.12s both;
  }

  @keyframes pie-chart-in {
    from {
      opacity: 0;
      transform: scale(0.92);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  body.page-home .mobile-piechart-legend {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  body.page-home .mobile-piechart-legend-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(8, 12, 18, 0.35);
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.2s ease;
    opacity: 0;
    transform: translateY(14px);
  }

  body.page-home .mobile-piechart-legend.legend-animate .mobile-piechart-legend-row {
    animation: pie-legend-in 0.5s ease-out forwards;
    animation-delay: calc(0.42s + var(--pie-i, 0) * 0.07s);
  }

  @keyframes pie-legend-in {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  body.page-home .mobile-piechart-legend-row.is-active {
    border-color: rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.08);
    transform: translateY(0) scale(1.01);
  }

  body.page-home .mobile-piechart-legend-row:active {
    transform: scale(0.98);
  }

  body.page-home .mobile-piechart-legend-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  body.page-home .mobile-piechart-legend-pair {
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
    flex: 1 1 auto;
    min-width: 72px;
  }

  body.page-home .mobile-piechart-legend-share {
    font-size: 12px;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.95);
  }

  body.page-home .mobile-piechart-legend-count {
    font-size: 11px;
    color: rgba(148, 163, 184, 0.75);
  }

  body.page-home .mobile-piechart-legend-pnl {
    font-size: 12px;
    font-weight: 600;
    color: #02c076;
    margin-left: auto;
  }

  body.page-home .mobile-performance-title,
  body.page-home .mobile-chart-title,
  body.page-home .mobile-histogram-title,
  body.page-home .mobile-piechart-title {
    font-weight: 700;
    color: #fff;
  }

  body.page-home #followersGrowthChart {
    background: rgba(18, 22, 31, 0.9) !important;
    border: 1px solid var(--tc-border) !important;
    border-radius: 14px !important;
  }

  body.page-home .mobile-main-cta-btn {
    box-shadow: 0 6px 24px var(--tc-accent-glow) !important;
  }
}

@media (min-width: 769px) and (max-width: 1023px) {
  .home-trust {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 16px;
  }

}
