/* ==========================================================================
   Kelid (کلید) · Landing page
   Same tokens as the console and docs (neutral surfaces, one indigo accent,
   Inter / Vazirmatn), with a richer marketing layer: gradient orbs, grid
   backdrop, animated routing diagram and a bento feature grid.
   English (LTR) and Persian (RTL) share one stylesheet via logical properties.
   ========================================================================== */

:root {
  --bg: #f7f8fb;
  --bg-alt: #eff1f6;
  --surface: #ffffff;
  --surface-2: #f3f4f8;
  --text: #11141d;
  --text-2: #4a5164;
  --text-3: #6b7285;
  --border: #e3e6ee;
  --border-strong: #cfd4de;
  --accent: #3f4fdc;
  --accent-2: #8b5cf6;
  --accent-3: #06b6d4;
  --accent-soft: #eceefd;
  --accent-text: #3241bd;
  --ok: #10a36a;
  --warn: #d98a06;
  --bad: #e0483f;
  --btn-primary: #11141d;
  --btn-primary-text: #fff;
  --glass: rgba(255, 255, 255, 0.72);
  --shadow-lg: 0 24px 60px -12px rgba(22, 28, 60, 0.18), 0 2px 6px rgba(22, 28, 60, 0.06);
  --shadow-md: 0 10px 30px -10px rgba(22, 28, 60, 0.16);
  --code-bg: #0e1018;
  --code-bar: #151826;
  --code-border: #232838;
  --grid-line: rgba(17, 20, 29, 0.055);
  --orb-opacity: 0.38;
  --p-openai: #10a37f;
  --p-gemini: #4285f4;
  --p-xai: #11141d;
  --p-byteplus: #f5432c;

  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-fa: Vazirmatn, Inter, ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 18px;
  --nav-h: 64px;
}

:root[data-theme="dark"] {
  --bg: #07080d;
  --bg-alt: #0b0d15;
  --surface: #10121b;
  --surface-2: #161927;
  --text: #eef0f7;
  --text-2: #a9afc2;
  --text-3: #7c8399;
  --border: #1f2332;
  --border-strong: #2d3246;
  --accent: #7d8bff;
  --accent-2: #a78bfa;
  --accent-3: #22d3ee;
  --accent-soft: #171b36;
  --accent-text: #a5afff;
  --btn-primary: #eef0f7;
  --btn-primary-text: #0a0b10;
  --glass: rgba(16, 18, 27, 0.7);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03);
  --shadow-md: 0 14px 40px -14px rgba(0, 0, 0, 0.6);
  --grid-line: rgba(255, 255, 255, 0.045);
  --orb-opacity: 0.4;
  --p-xai: #eef0f7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07080d;
    --bg-alt: #0b0d15;
    --surface: #10121b;
    --surface-2: #161927;
    --text: #eef0f7;
    --text-2: #a9afc2;
    --text-3: #7c8399;
    --border: #1f2332;
    --border-strong: #2d3246;
    --accent: #7d8bff;
    --accent-2: #a78bfa;
    --accent-3: #22d3ee;
    --accent-soft: #171b36;
    --accent-text: #a5afff;
    --btn-primary: #eef0f7;
    --btn-primary-text: #0a0b10;
    --glass: rgba(16, 18, 27, 0.7);
    --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03);
    --shadow-md: 0 14px 40px -14px rgba(0, 0, 0, 0.6);
    --grid-line: rgba(255, 255, 255, 0.045);
    --orb-opacity: 0.4;
    --p-xai: #eef0f7;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
html[lang="fa"] body { font-family: var(--font-fa); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { display: block; }
code, .mono { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip-link { position: absolute; inset-inline-start: 12px; top: -48px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 8px; transition: top .2s; }
.skip-link:focus { top: 12px; }

.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 24px; }
.narrow { max-width: 820px; }
.center { display: flex; justify-content: center; margin-top: 36px; }
.muted { color: var(--text-3); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding-inline: 16px; border-radius: 11px; border: 1px solid transparent;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .18s ease, background .18s, box-shadow .18s, border-color .18s;
}
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-1px); }
.btn-lg { height: 50px; padding-inline: 22px; font-size: 15.5px; border-radius: 13px; }
.btn-primary { background: var(--btn-primary); color: var(--btn-primary-text); box-shadow: 0 8px 24px -8px rgba(17, 20, 29, .45); }
.btn-primary:hover { box-shadow: 0 12px 30px -8px color-mix(in srgb, var(--accent) 60%, transparent); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); transform: none; }
.btn-outline { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); }
.btn-light { background: #fff; color: #11141d; }
.btn-glass { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .25); backdrop-filter: blur(8px); }
.btn-glass:hover { background: rgba(255, 255, 255, .2); }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); border-bottom: 1px solid transparent; transition: background .25s, border-color .25s, backdrop-filter .25s; }
.nav.scrolled { background: var(--glass); border-bottom-color: var(--border); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); }
.nav-inner { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand-mark svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-text { display: inline-flex; align-items: center; font-family: var(--font); }
.brand-fa { font-family: var(--font-fa); font-weight: 600; color: var(--text-3); border-inline-start: 1px solid var(--border-strong); margin-inline-start: 9px; padding-inline-start: 9px; font-size: 15px; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a { padding: 7px 12px; border-radius: 9px; color: var(--text-2); font-size: 14px; font-weight: 500; transition: color .15s, background .15s; }
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.lang-btn { height: 36px; padding-inline: 12px; border-radius: 10px; border: 1px solid var(--border); display: inline-flex; align-items: center; font-size: 13.5px; font-weight: 600; color: var(--text-2); background: var(--surface); }
.lang-btn:hover { color: var(--text); border-color: var(--border-strong); }
.lang-btn span:lang(fa), html[lang="en"] .lang-btn { font-family: var(--font-fa); }
html[lang="fa"] .lang-btn { font-family: var(--font); }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); }
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; padding: 72px 0 40px; margin-top: calc(var(--nav-h) * -1); padding-top: calc(var(--nav-h) + 72px); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: var(--orb-opacity); animation: float 18s ease-in-out infinite; }
.orb-1 { width: 520px; height: 520px; background: var(--accent); top: -180px; inset-inline-start: -120px; }
.orb-2 { width: 460px; height: 460px; background: var(--accent-2); top: -60px; inset-inline-end: -140px; animation-delay: -6s; }
.orb-3 { width: 380px; height: 380px; background: var(--accent-3); top: 320px; inset-inline-start: 40%; opacity: calc(var(--orb-opacity) * .55); animation-delay: -12s; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(40px, 30px) scale(1.05); } 66% { transform: translate(-30px, 20px) scale(.97); } }
.grid-bg {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.02fr 1fr; gap: 56px; align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--border); backdrop-filter: blur(10px);
  font-size: 13px; font-weight: 500; color: var(--text-2); box-shadow: var(--shadow-md);
}
.pill:hover { color: var(--text); border-color: var(--border-strong); }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 22%, transparent); animation: blink 2.2s infinite; }
@keyframes blink { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--ok) 0%, transparent); } }
.pill-arrow { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
[dir="rtl"] .pill-arrow { transform: scaleX(-1); }
h1 { font-size: clamp(40px, 6.2vw, 72px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 800; margin: 22px 0 20px; }
h1 span { display: block; }
html[lang="fa"] h1 { letter-spacing: -0.01em; line-height: 1.25; }
.grad {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 45%, var(--accent-3) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% auto; animation: shine 8s linear infinite;
  padding-bottom: .08em;
}
@keyframes shine { to { background-position: 200% center; } }
.lead { font-size: clamp(16px, 1.6vw, 18.5px); color: var(--text-2); max-width: 560px; margin: 0 0 30px; line-height: 1.7; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-points { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--text-2); font-size: 14px; }
.hero-points li { display: inline-flex; align-items: center; gap: 7px; }
.hero-points svg { width: 16px; height: 16px; fill: none; stroke: var(--ok); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Code window */
.hero-visual { position: relative; min-width: 0; }
.hero-copy { min-width: 0; animation: rise .8s cubic-bezier(.2,.7,.2,1) both; }
.hero-visual { animation: rise .9s cubic-bezier(.2,.7,.2,1) .15s both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.window {
  position: relative; direction: ltr; text-align: left;
  background: var(--code-bg); border: 1px solid var(--code-border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,.02); overflow: hidden;
  transform: perspective(1400px) rotateY(-5deg) rotateX(3deg); transition: transform .5s ease;
}
[dir="rtl"] .window { transform: perspective(1400px) rotateY(5deg) rotateX(3deg); }
.hero-visual:hover .window { transform: none; }
.window::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 70%, transparent), transparent 40%, transparent 60%, color-mix(in srgb, var(--accent-2) 60%, transparent)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.window-bar { display: flex; align-items: center; gap: 14px; padding: 10px 12px; background: var(--code-bar); border-bottom: 1px solid var(--code-border); }
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; }
.dots i:nth-child(3) { background: #28c840; }
.tabs { display: flex; gap: 2px; flex: 1; }
.tab { border: 0; background: none; color: #7f879c; font: 500 12.5px var(--mono); padding: 5px 10px; border-radius: 7px; }
.tab:hover { color: #d7dbe6; }
.tab.on { color: #fff; background: rgba(255,255,255,.08); }
.copy { border: 0; background: rgba(255,255,255,.06); color: #aab1c3; width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.copy:hover { color: #fff; background: rgba(255,255,255,.12); }
.copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.code { display: none; margin: 0; padding: 20px 22px; color: #d9deea; font: 13.2px/1.75 var(--mono); overflow-x: auto; min-height: 290px; }
.code.on { display: block; animation: fadeIn .35s ease; }
.code .k { color: #c792ea; } .code .s { color: #a5e3a0; } .code .f { color: #82aaff; } .code .v { color: #ffcb6b; }
.code .hl { display: inline-block; width: calc(100% + 44px); margin-inline: -22px; padding-inline: 22px; background: linear-gradient(90deg, rgba(125,139,255,.18), rgba(125,139,255,.04)); box-shadow: inset 3px 0 0 #7d8bff; }
.model-cycle { display: inline-block; transition: opacity .25s, transform .25s; }
.model-cycle.swap { opacity: 0; transform: translateY(-5px); }
.window-foot { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--code-border); background: var(--code-bar); font-size: 12px; color: #8a91a5; flex-wrap: wrap; }
.window-foot .muted { color: #5f6679; margin-inline-start: auto; }
.status { display: inline-flex; align-items: center; gap: 6px; color: #5ee3a1; font: 600 12px var(--mono); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: #5ee3a1; box-shadow: 0 0 10px #5ee3a1; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.float-card {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--border); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-md); font-size: 13px; animation: bob 6s ease-in-out infinite;
}
.float-card strong { display: block; font-size: 13px; }
.float-card small { color: var(--text-3); font: 11.5px var(--mono); }
.fc-1 { bottom: -22px; inset-inline-start: -28px; }
.fc-2 { top: 36%; inset-inline-end: -30px; animation-delay: -3s; min-width: 170px; }
.fc-ico { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text); }
.fc-ico.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.fc-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fc-bar { height: 6px; width: 110px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.fc-bar i { display: block; height: 100%; width: 64%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); animation: grow 3s ease-in-out infinite alternate; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes grow { from { width: 38%; } to { width: 72%; } }

/* Provider marquee */
.providers { margin-top: 84px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.providers-label { font-size: 13px; color: var(--text-3); font-weight: 500; }
.marquee { width: 100%; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); direction: ltr; }
.marquee-track { display: flex; gap: 48px; width: max-content; animation: marquee 30s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.prov { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--text-2); letter-spacing: -0.01em; white-space: nowrap; font-family: var(--font); }
@keyframes marquee { to { transform: translateX(-50%); } }
.pd { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.p-openai { background: var(--p-openai); fill: var(--p-openai); }
.p-gemini { background: var(--p-gemini); fill: var(--p-gemini); }
.p-xai { background: var(--p-xai); fill: var(--p-xai); }
.p-byteplus { background: var(--p-byteplus); fill: var(--p-byteplus); }

/* ---------- Stats ---------- */
.stats-sec { padding: 40px 0 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.stat { padding: 28px 26px; border-inline-end: 1px solid var(--border); }
.stat:last-child { border-inline-end: 0; }
.stat strong { display: block; font-size: 42px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; background: linear-gradient(180deg, var(--text), color-mix(in srgb, var(--text) 55%, transparent)); -webkit-background-clip: text; background-clip: text; color: transparent; font-family: var(--font); }
.stat span { display: block; margin-top: 10px; font-size: 14px; color: var(--text-2); }

/* ---------- Sections ---------- */
.section { padding: 110px 0; position: relative; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.sec-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.eyebrow { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); background: var(--accent-soft); padding: 5px 12px; border-radius: 999px; }
html[lang="fa"] .eyebrow { letter-spacing: 0; }
h2 { font-size: clamp(30px, 4vw, 46px); line-height: 1.12; letter-spacing: -0.03em; font-weight: 800; margin: 18px 0 16px; }
html[lang="fa"] h2 { letter-spacing: -0.005em; line-height: 1.35; }
.sec-head p { color: var(--text-2); font-size: 17px; margin: 0; }

/* Flow diagram */
.flow { border: 1px solid var(--border); border-radius: 24px; background: var(--surface); padding: 28px; box-shadow: var(--shadow-md); position: relative; overflow: hidden; }
.flow::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(var(--grid-line) 1.2px, transparent 1.2px); background-size: 22px 22px; opacity: 1.6; }
.flow-svg { position: relative; width: 100%; height: auto; direction: ltr; font-family: var(--font); }
.wire { fill: none; stroke: var(--border-strong); stroke-width: 2; stroke-dasharray: 4 6; }
.pulse { fill: none; stroke: url(#gLine); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 60 400; stroke-dashoffset: 460; animation: flow 2.8s cubic-bezier(.5,0,.3,1) infinite; }
.pulse.p2 { animation-delay: .9s; } .pulse.p3 { animation-delay: 1.3s; } .pulse.p4 { animation-delay: 1.7s; } .pulse.p5 { animation-delay: 2.1s; }
@keyframes flow { to { stroke-dashoffset: 0; } }
.node rect, .pnode rect { fill: var(--surface); stroke: var(--border-strong); stroke-width: 1.2; }
.node-ico rect, .node-ico path { fill: none; stroke: var(--text-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.core rect { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; filter: drop-shadow(0 12px 28px color-mix(in srgb, var(--accent) 35%, transparent)); }
.core-key circle, .core-key path { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.core-glow { animation: breathe 4s ease-in-out infinite; transform-origin: 480px 180px; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .7; } }
.t1 { fill: var(--text); font-size: 16px; font-weight: 700; }
.t1.sm { font-size: 14.5px; font-weight: 600; }
.core-name { font-size: 22px; font-weight: 800; }
.t2 { fill: var(--text-3); font-size: 12px; font-family: var(--mono); }
html[lang="fa"] .flow-svg [data-i18n-svg] { font-family: var(--font-fa); }

.steps { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { padding: 26px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); position: relative; transition: transform .25s, box-shadow .25s, border-color .25s; }
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.step-n { font: 700 13px var(--mono); color: var(--accent-text); background: var(--accent-soft); padding: 4px 9px; border-radius: 8px; }
.step h3 { margin: 16px 0 8px; font-size: 19px; letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--text-2); font-size: 15px; }

/* Bento */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  position: relative; padding: 28px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface);
  overflow: hidden; transition: transform .3s, box-shadow .3s, border-color .3s; isolation: isolate;
}
.card::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .3s; background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%); }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.card:hover::after { opacity: 1; }
.c-wide { grid-column: span 2; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.card-ico { width: 44px; height: 44px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-2) 14%, var(--surface))); color: var(--accent-text); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); }
.card-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { margin: 18px 0 8px; font-size: 19px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--text-2); font-size: 15px; }
.paths { display: flex; flex-direction: column; gap: 8px; direction: ltr; }
.path-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; }
.path-row code { color: var(--text); font-weight: 500; }
.hl-row { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.tag { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 2px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); }
.tag.accent { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.spark { margin-top: 22px; height: 64px; }
.spark svg { width: 100%; height: 100%; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-dasharray: 400; stroke-dashoffset: 400; }
.in .spark-line { animation: draw 1.8s ease forwards .3s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.meter { margin-top: 22px; }
.meter-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.meter-bar { height: 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.meter-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--ok), var(--warn)); transition: width 1.6s cubic-bezier(.2,.8,.2,1) .3s; }
.in .meter-bar i { width: 68%; }
.timeline { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; direction: ltr; }
.tl { display: flex; align-items: center; gap: 10px; font: 12.5px var(--mono); color: var(--text-2); padding: 7px 11px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); opacity: 0; transform: translateX(-8px); transition: opacity .4s, transform .4s; }
.in .tl { opacity: 1; transform: none; }
.in .tl:nth-child(2) { transition-delay: .35s; } .in .tl:nth-child(3) { transition-delay: .7s; }
.tl i { width: 8px; height: 8px; border-radius: 50%; }
.tl i.bad { background: var(--bad); } .tl i.warn { background: var(--warn); } .tl i.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.wallet { display: flex; justify-content: center; }
.wallet-card {
  width: 100%; max-width: 320px; aspect-ratio: 1.6; border-radius: 20px; padding: 22px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #3f4fdc 0%, #7c4ddf 55%, #0ea5c6 120%);
  box-shadow: 0 20px 40px -14px rgba(63, 79, 220, .55); display: flex; flex-direction: column; justify-content: space-between;
  transform: rotate(-3deg); transition: transform .4s;
}
[dir="rtl"] .wallet-card { transform: rotate(3deg); }
.card:hover .wallet-card { transform: rotate(0); }
.wallet-card::before { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.12); top: -110px; inset-inline-end: -70px; }
.wallet-card::after { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; border: 22px solid rgba(255,255,255,.08); bottom: -70px; inset-inline-start: -40px; }
.wc-label { font-size: 12.5px; opacity: .85; position: relative; }
.wc-amount { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; position: relative; }
.wc-amount small { font-size: 14px; font-weight: 600; opacity: .85; }
.wc-row { display: flex; justify-content: space-between; align-items: center; position: relative; }
.wc-key { font-size: 12px; opacity: .85; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip { font: 500 12.5px var(--mono); padding: 5px 11px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.ok-chip { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.28); color: #fff; font-family: inherit; font-weight: 600; }

/* Just released */
.new-sec { overflow: hidden; }
.new-glow { position: absolute; width: 900px; height: 500px; left: 50%; top: 40px; transform: translateX(-50%); background: radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent); filter: blur(30px); pointer-events: none; }
.new-sec .container { position: relative; }
.eyebrow-new { display: inline-flex; align-items: center; gap: 8px; }
.eyebrow-new i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); animation: blink 2.2s infinite; }
.new-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ncard { position: relative; padding: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; transition: transform .3s, box-shadow .3s; }
.ncard::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 55%, transparent), transparent 45%, transparent 60%, color-mix(in srgb, var(--accent-2) 45%, transparent)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.ncard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.ncard-hero { grid-row: span 2; background: radial-gradient(600px 300px at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--surface); }
.ncard.ncard-hero h3 { font-size: 56px; line-height: 1; letter-spacing: -0.035em; background: linear-gradient(100deg, var(--accent), var(--accent-2) 55%, var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.effort-scale { display: flex; gap: 6px; margin-top: 14px; direction: ltr; }
.effort-scale span { flex: 1; text-align: center; font: 500 11px var(--mono); color: var(--text-3); padding-top: 34px; position: relative; }
.effort-scale span::before { content: ""; position: absolute; left: 0; right: 0; bottom: 20px; height: calc(var(--h) * 1px); border-radius: 6px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); opacity: calc(.35 + var(--h) / 120); }
.effort-scale { height: 130px; align-items: flex-end; }
.ncard-top { display: flex; justify-content: space-between; align-items: center; }
.ncard-prov { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); font-family: var(--font); }
.badge-new, .pill-new, .tag-new { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); padding: 3px 9px; border-radius: 99px; }
html[lang="fa"] .badge-new, html[lang="fa"] .pill-new, html[lang="fa"] .tag-new { letter-spacing: 0; text-transform: none; }
.pill-new { font-size: 10.5px; padding: 2px 8px; }
.mcard li .tag-new { font-size: 10px; padding: 1px 7px; color: #fff; }
.ncard h3 { margin: 4px 0 0; font-size: 24px; letter-spacing: -0.02em; font-family: var(--font); }
.ncard p { margin: 0; color: var(--text-2); font-size: 14.5px; }
.ncard-models { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; direction: ltr; }
[dir="rtl"] .ncard-models { justify-content: flex-end; }
.ncard-models code { font-size: 12px; padding: 4px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.ncard-specs { list-style: none; padding: 16px 0 0; margin: 4px 0 0; display: flex; gap: 22px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.ncard-specs li { display: flex; flex-direction: column; }
.ncard-specs b { font: 700 18px var(--font); letter-spacing: -0.02em; direction: ltr; unicode-bidi: isolate; }
.ncard-specs span { font-size: 12px; color: var(--text-3); }

/* Models */
.model-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.mcard { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 20px; transition: transform .25s, box-shadow .25s; }
.mcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.mhead { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 14px; font-family: var(--font); }
.mhead em { margin-inline-start: auto; font-style: normal; font: 600 12px var(--mono); color: var(--text-3); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; }
.mcard ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.mcard li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--border); font-size: 13px; }
.mcard li code { font-size: 12.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard li span { color: var(--text-3); font-size: 12px; white-space: nowrap; }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq details { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.faq details[open] { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 600; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 10px; height: 10px; border-inline-end: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg) translateY(-3px); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(225deg) translateY(-3px); }
.faq details p { margin: 0; padding: 0 22px 20px; color: var(--text-2); }

/* CTA */
.cta {
  position: relative; overflow: hidden; border-radius: 28px; padding: 80px 32px; text-align: center; color: #fff;
  background: radial-gradient(900px 400px at 20% -10%, #7c4ddf 0%, transparent 60%), radial-gradient(800px 400px at 110% 120%, #0ea5c6 0%, transparent 55%), linear-gradient(135deg, #2b36b8, #3f4fdc 45%, #5b3fd6);
  box-shadow: 0 40px 80px -30px rgba(63, 79, 220, .6);
}
.cta-bg { position: absolute; inset: 0; --grid-line: rgba(255,255,255,.08); }
.cta-bg .grid-bg { mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 20%, transparent 80%); -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 50%, #000 20%, transparent 80%); }
.cta > * { position: relative; }
.cta-key { width: 64px; height: 64px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(8px); animation: bob 5s ease-in-out infinite; }
.cta-key svg { width: 32px; height: 32px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cta h2 { color: #fff; max-width: 680px; margin-inline: auto; }
.cta p { color: rgba(255,255,255,.82); font-size: 17.5px; max-width: 560px; margin: 0 auto 32px; }
.center-row { justify-content: center; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 56px 0 28px; background: var(--bg); }
.foot-inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.foot-brand p { color: var(--text-3); margin: 14px 0 0; font-size: 14px; }
.foot-cols { display: flex; gap: 72px; }
.foot-cols h4 { margin: 0 0 14px; font-size: 13px; color: var(--text); }
.foot-cols a { display: block; color: var(--text-3); font-size: 14px; padding: 4px 0; }
.foot-cols a:hover { color: var(--text); }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-3); }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-size: 13.5px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 80; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Reveal on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1) var(--d, 0s), transform .7s cubic-bezier(.2,.7,.2,1) var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 64px; }
  .hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
  .lead { margin-inline: auto; }
  .hero-cta, .hero-points { justify-content: center; }
  .hero-visual { max-width: 640px; margin-inline: auto; width: 100%; }
  .window, [dir="rtl"] .window { transform: none; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .model-grid { grid-template-columns: repeat(2, 1fr); }
  .new-grid { grid-template-columns: repeat(2, 1fr); }
  .ncard-hero { grid-row: auto; grid-column: span 2; }
}
@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-inner { justify-content: space-between; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-inline-end: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .steps { grid-template-columns: 1fr; }
  .c-wide { grid-column: span 2; grid-template-columns: 1fr; }
  .flow { padding: 14px; overflow-x: auto; }
  .flow-svg { min-width: 640px; }
  .section { padding: 80px 0; }
}
@media (max-width: 600px) {
  .container { padding-inline: 16px; }
  .hide-sm { display: none; }
  .brand-fa { display: none; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn { height: 36px; padding-inline: 12px; font-size: 13px; }
  .hero { padding-top: calc(var(--nav-h) + 44px); }
  .bento, .model-grid, .new-grid { grid-template-columns: 1fr; }
  .ncard-hero { grid-column: auto; }
  .ncard.ncard-hero h3 { font-size: 40px; }
  .c-wide { grid-column: auto; }
  .float-card { display: none; }
  .orb-1 { width: 320px; height: 320px; }
  .orb-2 { width: 280px; height: 280px; }
  .orb-3 { display: none; }
  .code { font-size: 12px; padding: 16px; min-height: 0; }
  .code .hl { width: calc(100% + 32px); margin-inline: -16px; padding-inline: 16px; }
  .window-foot .mono:not(.muted) { display: none; }
  .stat { padding: 22px 18px; }
  .stat strong { font-size: 34px; }
  .cta { padding: 56px 20px; border-radius: 22px; }
  .foot-cols { gap: 40px; }
  .btn-lg { width: 100%; }
  .hero-cta { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .pulse { display: none; }
}
