:root {
  --ink: #0b0b12;
  --ink-2: #464a57;
  --muted: #7a7f8c;
  --line: #e7e7ec;
  --bg: #ffffff;
  --bg-alt: #f6f6f8;
  --night: #0b0b12;
  --accent: #6d5efc;
  --sans: 'Inter', 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --shadow: 0 1px 2px rgba(16, 16, 24, .04), 0 8px 24px -12px rgba(16, 16, 24, .12);
  --shadow-lg: 0 2px 4px rgba(16, 16, 24, .04), 0 30px 60px -24px rgba(16, 16, 24, .28);
}
html[lang="fa"] { --sans: 'Vazirmatn', 'Inter', system-ui, sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.03em; font-weight: 700; }
p { margin: 0 0 1em; }
html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3 { letter-spacing: 0; line-height: 1.45; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em; white-space: nowrap;
  padding: .7em 1.2em; border-radius: 10px; font: inherit; font-weight: 600; font-size: .94rem;
  border: 1px solid transparent; cursor: pointer; transition: background .2s, border-color .2s, transform .2s;
}
.btn-sm { padding: .5em .95em; font-size: .86rem; }
.btn-lg { padding: .85em 1.5em; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: #ececf1; }
.btn-line { color: #fff; border-color: rgba(255,255,255,.25); }
.btn-line:hover { border-color: rgba(255,255,255,.6); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #262634; }

/* Top bar */
.topbar { position: fixed; inset-inline: 0; top: 0; z-index: 50; color: #fff; transition: background .25s, color .25s, border-color .25s; border-bottom: 1px solid transparent; }
.topbar.scrolled { background: rgba(255,255,255,.88); backdrop-filter: saturate(1.5) blur(14px); color: var(--ink); border-color: var(--line); }
.topbar.scrolled .btn-white { background: var(--ink); color: #fff; }
.topbar-inner { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: .6em; font-weight: 700; font-size: 1.05rem; letter-spacing: -.01em; }
.logo-mark { width: 22px; height: 22px; border-radius: 6px; border: 2.5px solid currentColor; position: relative; }
.logo-mark::after { content: ""; position: absolute; inset-inline: 0; top: 5px; border-top: 2.5px solid currentColor; }
.toplinks { display: flex; gap: 2rem; font-size: .93rem; font-weight: 500; opacity: .8; }
.toplinks a:hover { opacity: .6; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: flex; border: 1px solid rgba(255,255,255,.25); border-radius: 8px; padding: 2px; }
.topbar.scrolled .lang-switch { border-color: var(--line); }
.lang-switch button { border: 0; background: none; color: inherit; font: inherit; font-size: .78rem; font-weight: 600; padding: .35em .7em; border-radius: 6px; cursor: pointer; opacity: .6; }
.lang-switch button.active { opacity: 1; background: rgba(255,255,255,.14); }
.topbar.scrolled .lang-switch button.active { background: var(--bg-alt); }

/* Hero */
.hero { position: relative; overflow: hidden; background: var(--night); color: #fff; padding: 180px 0 140px; text-align: center; }
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(109, 94, 252, .35), transparent 70%),
    radial-gradient(40% 40% at 85% 100%, rgba(56, 189, 248, .12), transparent 70%);
}
.hero-glow::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 72px 72px; mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000, transparent 75%);
}
.hero-inner { position: relative; max-width: 860px; }
.kicker { display: inline-block; font-size: .85rem; font-weight: 500; color: rgba(255,255,255,.7); padding: .4em 1em; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; margin-bottom: 28px; }
.hero h1 { font-size: clamp(2.6rem, 6.6vw, 5.2rem); font-weight: 700; letter-spacing: -.04em; margin-bottom: 22px; }
.hero h1 em { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -.01em; color: #c9c3ff; }
html[lang="fa"] .hero h1 em { font-family: inherit; font-style: normal; font-weight: 800; }
.lead { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: rgba(255,255,255,.65); max-width: 600px; margin: 0 auto 36px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Sections */
.section { padding: 110px 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 40px; display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); margin: 0; }
.section-head p { color: var(--muted); margin: 0; }

/* Example cards with live thumbnails */
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 24px; }
.type-card { all: unset; cursor: pointer; display: block; }
.type-card:focus-visible .thumb { outline: 3px solid var(--accent); outline-offset: 3px; }
.thumb {
  position: relative; aspect-ratio: 16 / 10.5; border-radius: 14px; overflow: hidden; background: var(--bg-alt);
  border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.thumb iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 840px; border: 0; transform-origin: 0 0; pointer-events: none; }
.thumb::after {
  content: attr(data-cta); position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(11, 11, 18, .55); color: #fff; font-weight: 600; font-size: .95rem; opacity: 0; transition: opacity .25s;
}
.type-card:hover .thumb { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.type-card:hover .thumb::after { opacity: 1; }
.type-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 14px; }
.type-meta h3 { font-size: 1.05rem; margin: 0; letter-spacing: -.01em; }
.type-meta span { color: var(--muted); font-size: .86rem; }

/* Studio */
.type-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.type-tabs button {
  font: inherit; font-size: .9rem; font-weight: 500; padding: .55em 1.05em; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); transition: all .2s;
}
.type-tabs button:hover { border-color: #c9c9d3; }
.type-tabs button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.studio { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px; position: sticky; top: 88px; }
.field { margin-bottom: 22px; }
.lbl { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.input { width: 100%; font: inherit; font-size: .94rem; padding: .62em .8em; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.input:focus { outline: 3px solid rgba(109, 94, 252, .18); border-color: var(--accent); }
.swatches { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.swatch {
  aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; background: var(--c); position: relative;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); transition: transform .15s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.swatch[data-dark]::after { content: ""; position: absolute; inset: 30%; border-radius: 50%; background: #0b0b12; opacity: .55; }
.custom-color { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: .85rem; color: var(--ink-2); cursor: pointer; }
.custom-color input { width: 28px; height: 28px; padding: 0; border: 1px solid var(--line); border-radius: 50%; overflow: hidden; cursor: pointer; background: none; }
.custom-color input::-webkit-color-swatch-wrapper { padding: 0; }
.custom-color input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.seg { display: flex; background: var(--bg-alt); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4em; border: 0; background: none;
  font: inherit; font-size: .86rem; font-weight: 500; padding: .5em; border-radius: 8px; cursor: pointer; color: var(--muted);
}
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }

.stage { min-width: 0; }
.browser {
  margin-inline: auto; max-width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-lg); transition: max-width .4s cubic-bezier(.2,.8,.2,1);
}
.browser[data-device="tablet"] { max-width: 800px; }
.browser[data-device="mobile"] { max-width: 400px; }
.browser-top { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fafafb; direction: ltr; }
.dots { display: flex; gap: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #dcdce2; }
.url { flex: 1; text-align: center; font-size: .8rem; color: var(--muted); background: var(--bg-alt); border-radius: 7px; padding: 4px 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.devices { display: flex; gap: 2px; }
.devices button { border: 0; background: none; color: var(--muted); width: 30px; height: 28px; border-radius: 7px; cursor: pointer; display: grid; place-items: center; }
.devices button.active { background: var(--bg-alt); color: var(--ink); }
.browser[data-device="mobile"] .dots { display: none; }
.frame-wrap { position: relative; }
#demoFrame { display: block; width: 100%; height: 760px; border: 0; background: #fff; }
.frame-loader { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.75); opacity: 0; pointer-events: none; transition: opacity .2s; }
.frame-loader.on { opacity: 1; }
.frame-loader span { width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.steps li { padding: 32px 32px 8px 0; }
html[dir="rtl"] .steps li { padding: 32px 0 8px 32px; }
.steps span { display: block; font-size: .85rem; font-weight: 600; color: var(--accent); margin-bottom: 18px; }
.steps h3 { font-size: 1.25rem; letter-spacing: -.02em; }
.steps p { color: var(--ink-2); margin: 0; }

/* CTA */
.cta { background: var(--night); color: #fff; }
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 40px; flex-wrap: wrap; }
.cta h2 { font-size: clamp(2rem, 4vw, 3rem); }
.cta p { color: rgba(255,255,255,.65); max-width: 520px; margin: 0; }
.cta p.cta-note { margin-top: 14px; font-size: .86rem; color: rgba(255,255,255,.45); }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.footer { background: var(--night); color: rgba(255,255,255,.45); font-size: .85rem; padding: 26px 0; border-top: 1px solid rgba(255,255,255,.08); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Reveal */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* Responsive */
@media (max-width: 1000px) {
  .types { grid-template-columns: repeat(2, 1fr); }
  .studio { grid-template-columns: 1fr; }
  .panel { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
  .panel .btn-block { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .toplinks { display: none; }
  .topbar .btn-white { display: none; }
  .hero { padding: 140px 0 96px; }
  .section { padding: 72px 0; }
  .types { grid-template-columns: 1fr; }
  .panel { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps li, html[dir="rtl"] .steps li { padding: 24px 0 0; }
  .devices { display: none; }
  .browser, .browser[data-device] { max-width: 100%; }
  #demoFrame { height: 640px; }
  .type-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
}
