/*
  The apps.<domain> site: the landing page (index.html) and the download page (download.html).
  Served by the panel's own nginx from /usr/share/nginx/html/apps, so /fonts, /icons and
  /downloads are the files the panel ships. No build step: the deploy only copies this folder.
  The tokens are the panel's (src/index.css :root), so site and app read as one product.
*/
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/inter-latin-wght.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 100 800; font-display: swap; src: url('/fonts/jetbrains-mono-latin-wght.woff2') format('woff2'); }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/vazirmatn-arabic-wght.woff2') format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/vazirmatn-latin-wght.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #0d121d;
  --bg-card: #111827;
  --bg-card-hover: #161f31;
  --border: #1e293b;
  --border-soft: #161f31;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --success: #10b981;
  --success-light: #34d399;
  --danger: #ef4444;
  --danger-light: #f87171;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', 'Cascadia Code', monospace;
  --page: 1160px;
  --gutter: 24px;
}
html[lang="fa"] { --sans: 'Vazirmatn', 'Inter', 'Segoe UI', Tahoma, sans-serif; }

/* Each product carries one tone: green follows, blue trades. */
[data-product="copy"] { --tone: var(--success); --tone-light: var(--success-light); }
[data-product="trade"] { --tone: var(--accent); --tone-light: var(--accent-light); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="fa"] body { line-height: 1.85; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; border-radius: 6px; }
.icon { width: 1em; height: 1em; flex-shrink: 0; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.wrap { width: 100%; max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter); }

/* The floor: a chart's faint grid and one glow per product. The only atmosphere on the page. */
.floor {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 30%, transparent 100%);
}
.floor::before, .floor::after {
  content: ''; position: absolute; width: 50vmax; height: 50vmax; border-radius: 50%;
  filter: blur(100px); opacity: 0.14;
}
.floor::before { background: var(--success); top: -22vmax; inset-inline-start: -14vmax; }
.floor::after { background: var(--accent); top: -12vmax; inset-inline-end: -18vmax; }

/* --- Header --------------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(10, 14, 23, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition);
}
.site-header[data-scrolled] { border-bottom-color: var(--border); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 6px 20px -6px rgba(59, 130, 246, 0.6);
  font-size: 18px; color: #fff;
}
.site-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.site-nav a {
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text-primary); background: var(--bg-card); }
.lang-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--bg-secondary);
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.lang-btn:hover { color: var(--text-primary); border-color: #334155; }
/* Scoped so it outranks `.btn`'s display, which is declared later. */
.site-header .header-cta { display: none; }

/* --- Buttons -------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), color var(--transition);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 30px -12px rgba(59, 130, 246, 0.8); }
.btn-primary:hover { background: #2563eb; }
.btn-ghost { background: var(--bg-card); border-color: var(--border); color: var(--text-primary); }
.btn-ghost:hover { background: var(--bg-card-hover); border-color: #334155; }
.btn-tone { background: var(--tone); color: #fff; }
.btn-tone:hover { filter: brightness(1.08); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }

/* --- Hero ----------------------------------------------------------------------------------- */
.hero { padding: 72px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted);
}
html[lang="fa"] .eyebrow { font-family: var(--sans); letter-spacing: 0; font-size: 13px; }
.eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--text-muted); }
.hero h1 {
  margin: 0 0 20px; font-size: clamp(36px, 5.2vw, 64px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800;
}
html[lang="fa"] .hero h1 { line-height: 1.3; letter-spacing: 0; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--success-light), var(--accent-light)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { margin: 0 0 32px; max-width: 34em; font-size: 18px; color: var(--text-secondary); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; font-size: 14px; color: var(--text-muted); }
.hero-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); }
.hero-links a:hover { color: var(--tone-light); }
.hero-links .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }

/* The two phones: Copy Trader in front, Advanced Trader behind it. */
.devices { position: relative; height: 560px; }
.device {
  position: absolute; width: 268px; height: 548px; padding: 14px;
  border-radius: 40px; border: 1px solid #243047;
  background: linear-gradient(180deg, #0f1522, #0b101a);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.8), inset 0 0 0 6px #070a11;
  display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif; direction: ltr;
}
.device::before { content: ''; align-self: center; width: 84px; height: 22px; border-radius: 12px; background: #05070c; flex-shrink: 0; }
/* The phones are pictures of the app, so they keep their layout in Persian too: `direction: ltr`
   above resolves these logical offsets to left/right on every page, and the tilt stays with them. */
.device-copy { inset-inline-start: 0; top: 10px; z-index: 2; transform: rotate(-3deg); }
.device-trade { inset-inline-end: 0; top: 0; transform: rotate(4deg); }
.m-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 0; }
.m-app { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.m-app img { width: 22px; height: 22px; border-radius: 6px; }
.m-pill { font-size: 10px; padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--tone) 18%, transparent); color: var(--tone-light); font-weight: 600; }
.m-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 12px; }
.m-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.m-big { font-family: var(--mono); font-size: 22px; font-weight: 700; margin-top: 2px; }
.m-up { color: var(--success-light); }
.m-down { color: var(--danger-light); }
.m-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--border-soft); font-size: 12px; }
.m-row:first-of-type { border-top: 0; }
.m-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; }
.m-row .grow { flex: 1; min-width: 0; }
.m-row .sub { display: block; font-size: 10px; color: var(--text-muted); }
.m-toggle { width: 26px; height: 15px; border-radius: 999px; background: var(--success); position: relative; flex-shrink: 0; }
.m-toggle::after { content: ''; position: absolute; top: 2px; right: 2px; width: 11px; height: 11px; border-radius: 50%; background: #fff; }
.m-toggle.off { background: #334155; }
.m-toggle.off::after { right: auto; left: 2px; }
.m-spark { display: block; width: 100%; height: 46px; margin-top: 8px; }
.m-chart { display: block; width: 100%; height: 170px; }
.m-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; border-radius: 10px; background: var(--bg-secondary); font-size: 11px; font-weight: 700; text-align: center; }
.m-seg span { padding: 6px; border-radius: 8px; color: var(--text-muted); }
.m-seg .on { background: var(--success); color: #fff; }
.m-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.m-field { background: var(--bg-secondary); border-radius: 8px; padding: 6px 8px; }
.m-field b { display: block; font-family: var(--mono); font-size: 11px; }
.m-field span { font-size: 9px; color: var(--text-muted); }
.m-cta { margin-top: 8px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--success); font-size: 12px; font-weight: 700; color: #fff; }

/* --- Sections ------------------------------------------------------------------------------- */
.section { padding: 88px 0; scroll-margin-top: 68px; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 { margin: 0 0 12px; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; letter-spacing: -0.025em; }
html[lang="fa"] .section-head h2 { letter-spacing: 0; line-height: 1.4; }
.section-head p { margin: 0; font-size: 17px; color: var(--text-secondary); }
.kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; font-weight: 700; color: var(--tone-light); }
.kicker img { width: 28px; height: 28px; border-radius: 8px; }

.product-block { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; }
.product-block + .product-block { margin-top: 96px; }
.product-block .section-head { margin-bottom: 28px; }
.product-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.feature {
  padding: 22px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--border);
  transition: border-color var(--transition), transform var(--transition);
}
.feature:hover { border-color: color-mix(in srgb, var(--tone) 45%, var(--border)); transform: translateY(-2px); }
.feature-icon {
  display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--tone) 14%, transparent); color: var(--tone-light); font-size: 20px;
}
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; font-size: 14px; color: var(--text-secondary); }

/* Which one: two columns, each with its own tone. */
.choose { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.choose-card {
  position: relative; padding: 30px; border-radius: var(--radius-lg); background: var(--bg-card);
  border: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column;
}
.choose-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--tone); }
.choose-card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 22px; }
.choose-card h3 img { width: 36px; height: 36px; border-radius: 10px; }
.choose-card > p { margin: 0 0 18px; color: var(--text-secondary); }
.ticks { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 10px; }
.ticks li { display: flex; gap: 10px; font-size: 15px; }
.ticks .icon { margin-top: 0.3em; color: var(--tone-light); font-size: 15px; }
.choose-card .btn { margin-top: auto; align-self: flex-start; }

/* Three ways in. */
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 32px; }
.way { padding: 24px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--border); }
.way .feature-icon { --tone: var(--accent); --tone-light: var(--accent-light); }
.way h3 { margin: 0 0 6px; font-size: 16px; }
.way p { margin: 0; font-size: 14px; color: var(--text-secondary); }

.band {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 28px 32px; border-radius: var(--radius-lg);
  background: linear-gradient(120deg, rgba(16, 185, 129, 0.12), rgba(59, 130, 246, 0.14));
  border: 1px solid #243047;
}
.band h3 { margin: 0 0 4px; font-size: 20px; }
.band p { margin: 0; color: var(--text-secondary); }

/* --- Download page -------------------------------------------------------------------------- */
.page-head { padding: 64px 0 36px; }
.page-head h1 { margin: 0 0 12px; font-size: clamp(32px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -0.03em; }
html[lang="fa"] .page-head h1 { letter-spacing: 0; line-height: 1.35; }
.page-head p { margin: 0; max-width: 40em; font-size: 17px; color: var(--text-secondary); }
.device-note {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; padding: 8px 14px;
  border-radius: 999px; background: var(--bg-card); border: 1px solid var(--border); font-size: 13px; color: var(--text-secondary);
}
.device-note .icon { color: var(--accent-light); }

.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dl-card {
  position: relative; display: flex; flex-direction: column; gap: 18px; padding: 28px;
  border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid var(--border); overflow: hidden;
}
.dl-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--tone); }
.dl-top { display: flex; align-items: center; gap: 16px; }
.dl-top img { width: 64px; height: 64px; border-radius: 16px; box-shadow: 0 12px 28px -12px var(--tone); }
.dl-top h2 { margin: 0; font-size: 22px; }
.dl-top p { margin: 2px 0 0; font-size: 14px; color: var(--text-secondary); }
.dl-actions { display: grid; gap: 10px; }
.dl-option {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: var(--bg-secondary); border: 1px solid var(--border); text-align: start; width: 100%; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.dl-option:hover { border-color: color-mix(in srgb, var(--tone) 55%, var(--border)); background: var(--bg-card-hover); }
.dl-option[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }
.dl-option .opt-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--tone) 16%, transparent); color: var(--tone-light); font-size: 19px; flex-shrink: 0; }
.dl-option .opt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dl-option .opt-label { font-weight: 600; font-size: 15px; }
.dl-option .opt-hint { font-size: 13px; color: var(--text-muted); }
.dl-option .opt-go { color: var(--text-muted); font-size: 18px; transition: transform var(--transition); }
.dl-option[aria-expanded="true"] .opt-go { transform: rotate(180deg); }
.dl-option.primary { background: color-mix(in srgb, var(--tone) 14%, var(--bg-secondary)); border-color: color-mix(in srgb, var(--tone) 40%, var(--border)); }

.steps-panel { display: none; padding: 16px; border-radius: 14px; background: var(--bg-secondary); border: 1px dashed var(--border); }
.steps-panel[data-open] { display: block; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--tone); border-color: var(--tone); color: #fff; }
.steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.steps b { color: var(--text-primary); font-weight: 600; }

.help { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.help-card { padding: 26px; border-radius: var(--radius); background: var(--bg-card); border: 1px solid var(--border); }
.help-card h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 17px; }
.help-card h3 .icon { color: var(--accent-light); }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td { padding: 10px 8px; text-align: start; border-top: 1px solid var(--border); }
.compare thead th { border-top: 0; color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
html[lang="fa"] .compare thead th { text-transform: none; letter-spacing: 0; }
.compare td { color: var(--text-secondary); }
.compare td:first-child { color: var(--text-primary); }

/* --- Footer --------------------------------------------------------------------------------- */
.site-footer { margin-top: 40px; padding: 40px 0 56px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }
.site-footer .wrap { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a:hover { color: var(--text-primary); }
.risk { grid-column: 1 / -1; margin: 0; max-width: 60em; font-size: 12px; line-height: 1.7; color: var(--text-muted); }

/* --- Motion: arrive once, never hide content that has not arrived --------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 600ms cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
  .rise-2 { animation-delay: 90ms; }
  .rise-3 { animation-delay: 180ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(14px); } }
}

/* --- Narrow screens ------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .hero .wrap, .product-block { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .devices { height: 470px; max-width: 520px; width: 100%; margin: 0 auto; }
  .device { transform-origin: top center; scale: 0.86; }
  .ways { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .site-nav { display: none; }
  .site-header .header-cta { display: inline-flex; margin-inline-start: auto; }
  .section { padding: 64px 0; }
  .features, .choose, .dl-grid, .help { grid-template-columns: 1fr; }
  .devices { height: 420px; }
  .device { scale: 0.74; }
  .device-copy { inset-inline-start: -8px; }
  .device-trade { inset-inline-end: -8px; }
  .lede { font-size: 16px; }
  .band { padding: 22px; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .dl-card, .choose-card { padding: 22px; }
}
@media (max-width: 400px) {
  .devices { height: 360px; }
  .device { scale: 0.64; }
  .brand-name { display: none; }
}
