/* ============================================================
   TradingView Download Site — shared stylesheet
   Dark violet theme, modern, responsive, no frameworks
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

:root {
  --bg-0: #07061a;
  --bg-1: #0d0a2a;
  --bg-2: #110d36;
  --surface: rgba(20, 16, 44, 0.62);
  --surface-2: rgba(28, 22, 60, 0.72);
  --border: rgba(167, 139, 250, 0.14);
  --border-strong: rgba(167, 139, 250, 0.32);
  --text-0: #f3f0ff;
  --text-1: #c9c2ee;
  --text-2: #8b85b3;
  --accent: #a78bfa;
  --accent-2: #c4b5fd;
  --accent-3: #7c3aed;
  --cyan: #38bdf8;
  --pink: #f472b6;
  --green: #34d399;
  --shadow-lg: 0 20px 60px -20px rgba(124, 58, 237, 0.45);
  --shadow-sm: 0 4px 16px -4px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Roboto, Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-0);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---------- Background field ---------- */
.bg {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(at 18% 12%, rgba(124, 58, 237, 0.32), transparent 55%),
    radial-gradient(at 82% 16%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(at 50% 95%, rgba(244, 114, 182, 0.16), transparent 55%),
    linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 60%, var(--bg-0) 100%);
}
.bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  opacity: 0.5;
}

/* ---------- Generic ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; position: relative; }
.section--tight { padding: 3.5rem 0; }
.kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 0 0 0.75rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.08);
}
.section__head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}
.section__head h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  background: linear-gradient(120deg, #fff 30%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section__head p {
  color: var(--text-1);
  font-size: 1.05rem;
  margin: 0;
}

/* Skip link */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff;
  padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  z-index: 1000;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  background: rgba(7, 6, 26, 0.72);
  border-bottom: 1px solid var(--border);
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 4.5rem; gap: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-weight: 800; font-size: 1.05rem;
  color: var(--text-0); text-decoration: none;
  letter-spacing: 0.01em;
}
.brand__mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(167, 139, 250, 0.08);
}
.brand__mark img {
  width: 100%; height: 100%;
  display: block;
  object-fit: contain;
}

.main-nav { display: none; }
@media (min-width: 880px) {
  .main-nav { display: block; }
  .main-nav ol {
    list-style: none; margin: 0; padding: 0;
    display: flex; gap: 0.25rem;
  }
  .main-nav a {
    display: inline-block;
    padding: 0.45rem 0.85rem;
    color: var(--text-1);
    text-decoration: none;
    font-size: 0.92rem;
    border-radius: var(--radius-sm);
    transition: color 0.18s, background 0.18s;
  }
  .main-nav a:hover { color: var(--text-0); background: rgba(167, 139, 250, 0.1); }
}

/* Language switch */
.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem; font-weight: 600;
  color: var(--text-0);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition: border-color 0.18s, background 0.18s;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary::after {
  content: "";
  width: 6px; height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.2s;
}
.lang-switch[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.lang-switch summary:hover { border-color: var(--accent); background: var(--surface-2); }
.lang-switch__menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 180px;
  list-style: none; margin: 0; padding: 0.4rem;
  background: rgba(13, 10, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.lang-switch__menu a {
  display: block; padding: 0.55rem 0.8rem;
  color: var(--text-0); text-decoration: none;
  font-size: 0.92rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.lang-switch__menu a:hover { background: rgba(167, 139, 250, 0.14); }
.lang-switch__menu a[aria-current="true"] {
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.22), rgba(167, 139, 250, 0.05));
  color: var(--accent-2);
  font-weight: 700;
}

/* ---------- Hero ---------- */
.hero { padding: 5rem 0 2rem; }
.hero__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 980px) {
  .hero__inner { grid-template-columns: 1.05fr 1fr; gap: 4rem; }
}
.hero__pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.8rem 0.35rem 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-1);
  margin-bottom: 1.25rem;
}
.hero__pill .dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
  animation: pulseDot 1.8s infinite;
}
@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18); }
  50%       { box-shadow: 0 0 0 8px rgba(52, 211, 153, 0.06); }
}
.hero__title {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
}
.hero__title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent-2) 0%, var(--cyan) 60%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub {
  font-size: 1.05rem;
  color: var(--text-1);
  margin: 0 0 1.8rem;
  max-width: 36rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.5rem; }
.hero__trust { display: flex; flex-wrap: wrap; gap: 1.25rem; color: var(--text-2); font-size: 0.88rem; }
.hero__trust span { display: inline-flex; align-items: center; gap: 0.4rem; }
.hero__trust svg { width: 14px; height: 14px; color: var(--green); }

.hero__visual {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, rgba(124,58,237,0.18), rgba(56,189,248,0.12));
  aspect-ratio: 16 / 10;
}
.hero__visual video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hero__visual::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(7,6,26,0.4));
  pointer-events: none;
  z-index: 1;
}
.hero__visual::after {
  content: "";
  position: absolute; inset: -1px;
  border-radius: var(--radius-xl);
  padding: 1px;
  background: linear-gradient(135deg, rgba(167,139,250,0.45), transparent 40%, rgba(56,189,248,0.35));
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem; font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent-3), var(--accent));
  box-shadow: 0 10px 28px -10px var(--accent-3);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px -10px var(--accent);
}
.btn--ghost {
  color: var(--text-0);
  background: var(--surface);
  border-color: var(--border-strong);
}
.btn--ghost:hover { border-color: var(--accent); background: var(--surface-2); }

/* ---------- Quick download tiles ---------- */
.quick-dl {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}
@media (min-width: 640px) { .quick-dl { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 880px) { .quick-dl { grid-template-columns: repeat(6, 1fr); } }
.dl-tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  padding: 1.2rem 0.8rem;
  text-decoration: none;
  color: var(--text-0);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.dl-tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 16px 30px -16px rgba(124, 58, 237, 0.55);
}
.dl-tile__ico {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  color: #fff;
  border: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 13px;
  background: rgba(167, 139, 250, 0.08);
  transition: transform 0.2s, border-color 0.2s, background 0.2s;
}
.dl-tile:hover .dl-tile__ico {
  transform: translateY(-1px);
  border-color: rgba(167, 139, 250, 0.28);
  background: rgba(167, 139, 250, 0.12);
}
.dl-tile__ico svg {
  width: 25px; height: 25px;
}
.dl-tile__name { font-weight: 700; font-size: 0.95rem; }
.dl-tile__meta { font-size: 0.78rem; color: var(--text-2); }

/* ---------- Feature grid ---------- */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 720px)  { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature {
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.feature:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.feature__ico {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(124,58,237,0.35), rgba(56,189,248,0.25));
  color: #fff; margin-bottom: 1rem;
}
.feature__ico svg { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 0.5rem; font-size: 1.1rem; font-weight: 700; }
.feature p { margin: 0; color: var(--text-1); font-size: 0.95rem; }

/* ---------- Platform detail cards ---------- */
.platforms {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}
@media (min-width: 760px)  { .platforms { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .platforms { grid-template-columns: repeat(3, 1fr); } }
.platform {
  padding: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; gap: 1rem;
}
.platform__head { display: flex; align-items: center; gap: 0.8rem; }
.platform__ico {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(167, 139, 250, 0.14);
  color: var(--accent-2);
}
.platform__ico svg { width: 24px; height: 24px; }
.platform__title { font-weight: 800; font-size: 1.08rem; margin: 0; }
.platform__sub { font-size: 0.85rem; color: var(--text-2); margin: 0; }
.platform__list { list-style: none; padding: 0; margin: 0; font-size: 0.9rem; color: var(--text-1); }
.platform__list li {
  padding: 0.35rem 0;
  border-top: 1px dashed var(--border);
  display: flex; justify-content: space-between; gap: 1rem;
}
.platform__list li:first-child { border-top: none; }
.platform__list b { color: var(--text-0); font-weight: 600; }
.platform__actions { display: flex; gap: 0.5rem; margin-top: auto; }
.platform__actions .btn { flex: 1; justify-content: center; padding: 0.7rem 1rem; font-size: 0.9rem; }

/* ---------- Stats strip ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { text-align: center; }
.stat__num {
  display: block;
  font-size: 1.8rem; font-weight: 800;
  background: linear-gradient(120deg, #fff, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__lbl { font-size: 0.85rem; color: var(--text-2); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 0.75rem; max-width: 820px; margin: 0 auto; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
  list-style: none; cursor: pointer;
  padding: 1.1rem 1.3rem;
  font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  color: var(--text-0);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem; font-weight: 400;
  color: var(--accent);
  transition: transform 0.2s;
  line-height: 1;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  margin: 0; padding: 0 1.3rem 1.2rem;
  color: var(--text-1); font-size: 0.95rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 3rem 0 2rem;
  background: linear-gradient(180deg, transparent, rgba(7,6,26,0.7));
}
.site-footer__top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (min-width: 760px) {
  .site-footer__top { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.site-footer__brand p { color: var(--text-2); font-size: 0.9rem; max-width: 24rem; margin: 0.5rem 0 0; }
.site-footer__col h4 {
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-2); margin: 0 0 0.8rem; font-weight: 700;
}
.site-footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.site-footer__col a {
  color: var(--text-1); text-decoration: none; font-size: 0.92rem;
  transition: color 0.15s;
}
.site-footer__col a:hover { color: var(--accent-2); }
.site-footer__bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.75rem;
  font-size: 0.82rem; color: var(--text-2);
}
@media (min-width: 760px) {
  .site-footer__bottom { flex-direction: row; justify-content: space-between; align-items: center; }
}
.site-footer__disclaimer {
  background: rgba(244, 114, 182, 0.08);
  border: 1px solid rgba(244, 114, 182, 0.18);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  color: var(--text-1);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

/* ---------- Reveal animation on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Release notes ---------- */
.release {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2.25rem;
  background: linear-gradient(135deg, rgba(124,58,237,0.10), rgba(56,189,248,0.06));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
@media (min-width: 880px) { .release { grid-template-columns: 1fr 1.4fr; gap: 3rem; align-items: start; } }
.release::before {
  content: "";
  position: absolute;
  top: -40%; right: -10%;
  width: 60%; height: 180%;
  background: radial-gradient(ellipse at center, rgba(167,139,250,0.18), transparent 60%);
  pointer-events: none;
}
.release__badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: rgba(52, 211, 153, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.34);
  color: var(--green);
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.release__title {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 800; letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}
.release__lede { color: var(--text-1); margin: 0; font-size: 0.95rem; }
.release__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.85rem; }
.release__list li {
  display: flex; gap: 0.75rem; align-items: flex-start;
  color: var(--text-0);
  font-size: 0.96rem;
}
.release__list strong { display: block; font-weight: 700; }
.release__list span { color: var(--text-1); font-size: 0.9rem; }
.release__list svg {
  flex-shrink: 0; width: 20px; height: 20px;
  color: var(--accent-2); margin-top: 2px;
}

/* Platform card — trust/signature line */
.platform__sign {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 0.25rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem; font-weight: 600;
  color: var(--green);
  background: rgba(52, 211, 153, 0.10);
  border: 1px solid rgba(52, 211, 153, 0.28);
  border-radius: 999px;
}
.platform__sign svg { width: 12px; height: 12px; }

/* Trust strip */
.trust-strip {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  font-size: 0.85rem; color: var(--text-1);
}
.trust-strip span { display: inline-flex; align-items: center; gap: 0.5rem; }
.trust-strip svg { width: 16px; height: 16px; color: var(--accent-2); flex-shrink: 0; }
.trust-strip .sep { color: var(--text-2); }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
