:root {
  --bg0: #10081f;
  --bg1: #2a1868;
  --bg2: #5b4ad6;
  --accent: #8ea2ff;
  --accent-2: #ddd6ff;
  --ink: #f7f4ff;
  --muted: #c9c0e6;
  --card: rgba(214, 204, 255, 0.08);
  --card-strong: rgba(255, 255, 255, 0.14);
  --stroke: rgba(220, 210, 255, 0.34);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --font: "Vazirmatn", "Segoe UI", sans-serif;
  --display: "Outfit", "Vazirmatn", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 100% -10%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 60%),
    radial-gradient(700px 480px at -10% 110%, color-mix(in srgb, var(--bg2) 70%, transparent), transparent 55%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 48%, var(--bg2));
  background-attachment: fixed;
}
body.ltr { font-family: var(--display); }
a { color: inherit; }
img { max-width: 100%; display: block; }

.page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}
.lang-screen {
  width: min(680px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 56px;
  padding: 48px 0 56px;
}
.brand {
  display: flex;
  justify-content: center;
}
.brand-glass {
  padding: 16px 26px 12px;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 46px rgba(6, 4, 20, 0.22);
}
.brand img {
  height: 92px;
  width: auto;
  background: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}
.prompts {
  text-align: center;
  display: grid;
  gap: 8px;
}
.prompts p {
  margin: 0;
  color: color-mix(in srgb, var(--muted) 78%, transparent);
  font-size: 0.92rem;
}
.prompts p:first-child { color: var(--ink); font-size: 1.2rem; font-weight: 700; }

.lang-grid {
  display: grid;
  gap: 14px;
}
.lang-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 96px;
  padding: 18px 22px;
  text-align: center;
  text-decoration: none;
  border-radius: 24px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: 0 18px 42px rgba(6, 4, 20, 0.28);
  backdrop-filter: blur(16px);
  transition: transform .25s ease, background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.flag {
  width: 36px;
  height: 26px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}
.lang-card strong {
  display: block;
  font-size: clamp(1.65rem, 4vw, 2.05rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.lang-card[lang="en"] strong {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.lang-card em {
  display: block;
  margin-top: 4px;
  color: color-mix(in srgb, var(--muted) 62%, transparent);
  font-style: normal;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}
.lang-card:hover, .lang-card:focus-visible {
  transform: translateY(-4px);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.1));
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow: 0 26px 50px rgba(6, 4, 20, 0.34);
  outline: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(1080px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 10px 12px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--card-strong), transparent);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(18px);
}
.topbar img {
  height: 52px;
  width: auto;
  background: linear-gradient(180deg, #f8fafc, #e8eef5);
  border-radius: 12px;
  padding: 4px 10px 2px;
}
.lang-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  white-space: nowrap;
}
.lang-link svg { width: 16px; height: 16px; }
.lang-link:hover, .lang-link:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.hero {
  padding: 42px 0 12px;
}
.eyebrow {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: .04em;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid var(--stroke);
}
h1 {
  margin: 0;
  font-size: clamp(1.85rem, 6.2vw, 3.5rem);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.ltr h1 { font-family: var(--display); letter-spacing: -0.04em; line-height: 1.08; }
.lede {
  margin: 16px 0 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.products {
  display: grid;
  gap: 16px;
  padding: 18px 0 36px;
}
.card {
  padding: 22px;
  border-radius: 26px;
  background: linear-gradient(165deg, var(--card-strong), var(--card) 42%, transparent);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background: linear-gradient(145deg, var(--accent), var(--bg2));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent);
}
.mark svg { width: 24px; height: 24px; }
.card h2 { margin: 0 0 8px; font-size: 1.35rem; }
.card p { margin: 0; color: var(--muted); line-height: 1.75; }
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}
.actions .btn { width: 100%; }
.btn.primary {
  color: #041018;
  background: linear-gradient(120deg, var(--accent-2), var(--accent) 45%, var(--bg2));
}
.btn.ghost {
  color: var(--ink);
  border-color: var(--stroke);
  background: rgba(255,255,255,.05);
}

.globe {
  position: fixed;
  z-index: 8;
  bottom: 18px;
  inset-inline-end: 18px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(6, 4, 20, 0.22);
  transition: transform .25s ease, background .25s ease;
}
.globe svg { width: 20px; height: 20px; }
.globe:hover, .globe:focus-visible {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.18);
  outline: none;
}

.footer {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto 72px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(255,255,255,.05));
}
.footer strong { display: block; margin-bottom: 8px; }
.footer a, .footer p { color: var(--muted); text-decoration: none; line-height: 1.7; }

dialog.modal:not([open]) { display: none; }
dialog.modal[open] {
  display: flex;
  flex-direction: column;
  width: min(460px, calc(100vw - 28px));
  max-height: min(90dvh, 720px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid var(--stroke);
  border-radius: 28px;
  background: linear-gradient(165deg, rgba(42, 24, 104, 0.96), rgba(16, 8, 31, 0.96));
  box-shadow: var(--shadow);
}
.modal::backdrop {
  background: rgba(8, 4, 20, 0.66);
  backdrop-filter: blur(8px);
}
.modal [hidden] { display: none !important; }
.modal form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  margin: 0;
}
@supports not selector(::-webkit-scrollbar) {
  .modal-scroll,
  .modal textarea {
    scrollbar-width: auto;
    scrollbar-color: #ddd6ff rgba(255, 255, 255, 0.14);
  }
}
.modal-scroll::-webkit-scrollbar,
.modal textarea::-webkit-scrollbar {
  width: 14px;
  height: 14px;
}
.modal-scroll::-webkit-scrollbar-corner,
.modal textarea::-webkit-scrollbar-corner {
  background: transparent;
}
.modal-scroll::-webkit-scrollbar-track,
.modal textarea::-webkit-scrollbar-track {
  margin: 10px 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}
.modal-scroll::-webkit-scrollbar-thumb,
.modal textarea::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #ddd6ff;
  min-height: 48px;
}
.modal-scroll::-webkit-scrollbar-thumb:hover,
.modal textarea::-webkit-scrollbar-thumb:hover {
  background: #ffffff;
}
.modal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  display: grid;
  gap: 12px;
  padding-block: 22px 16px;
  padding-inline: 22px 10px;
  scrollbar-gutter: stable;
}
.demo-success {
  display: grid;
  gap: 14px;
  padding: 28px 22px;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.modal h2 { margin: 0; font-size: 1.35rem; }
.modal-lede, .demo-success p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}
.icon-close {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.field { display: grid; gap: 6px; }
.field span { font-weight: 700; font-size: 0.92rem; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: inherit;
}
.field textarea { min-height: 88px; resize: vertical; }
.field small, .form-error {
  min-height: 0;
  color: #ffb4c8;
  font-size: 0.82rem;
}
.modal-actions {
  display: grid;
  gap: 10px;
  padding: 12px 22px 22px;
}
.demo-success .btn { width: 100%; }
.footer .row { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ltr-num { direction: ltr; unicode-bidi: isolate; }

.rise { animation: rise .7s ease both; }
.d1 { animation-delay: .14s; }
.d2 { animation-delay: .28s; }
.d3 { animation-delay: .42s; }
.d4 { animation-delay: .56s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

@media (min-width: 720px) {
  .products { grid-template-columns: 1fr 1fr; }
  .lang-grid { grid-template-columns: repeat(3, 1fr); }
  .lang-card {
    gap: 0;
    min-height: 188px;
    padding: 22px;
  }
  .flag { margin-bottom: 22px; }
  .actions { flex-direction: row; }
  .actions .btn { width: auto; flex: 1; }
  .brand img { height: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  .lang-card { transition: none; }
  .modal-scroll { scroll-behavior: auto; }
}

.story { --paper: #fbfafe; --line: #ddd7ef; --story: #16122b; --story-muted: #5c5678; }
.story-stage {
  min-height: calc(100dvh - 96px);
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 36px;
  padding: 36px 0 28px;
}
.story .intro { max-width: 40rem; margin: 0 auto; text-align: center; }
.story .kicker {
  margin: 0 0 14px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #ddd6ff;
}
.story h1 {
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.2;
  letter-spacing: -0.04em;
}
.story .lede { max-width: 36rem; color: #c9c0e6; }
.story .pair {
  position: relative;
  display: grid;
  background: var(--paper);
  color: var(--story);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
  animation: flow-in .9s cubic-bezier(.16, 1, .3, 1) .08s both;
}
.story .pair::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #22d3ee, #a78bfa 50%, #fb7185);
}
.story .pair article {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 14px;
  row-gap: 8px;
  align-items: center;
  padding: 28px 28px 24px;
}
.story .pair article + article { border-top: 1px solid var(--line); }
.story .pair h2 { grid-column: 2; margin: 0; font-size: .82rem; font-weight: 700; color: #6d5cae; }
.story .ask { grid-column: 1 / -1; margin: 8px 0 0; font-size: 1.18rem; font-weight: 800; line-height: 1.55; color: var(--story); }
.story .pair p { grid-column: 1 / -1; margin: 8px 0 0; color: var(--story-muted); line-height: 1.8; }
.story .pair .ask { font-size: 1.18rem; font-weight: 800; line-height: 1.55; color: var(--story); }
.story .pair .actions, .story .more { grid-column: 1 / -1; }
.story .mark {
  width: 42px; height: 42px; margin: 0;
  display: grid; place-items: center;
  border-radius: 12px;
  background: #f4f1fb;
  box-shadow: none;
}
.story .mark svg { width: 22px; height: 22px; }
.story .pair .actions { margin-top: 16px; }
.story .pair .btn { flex: 0 1 auto; width: auto; min-width: 132px; min-height: 44px; }
.story .btn.ghost { color: var(--story); border-color: var(--line); background: #fff; }
.story .more {
  justify-self: start;
  margin-top: 12px;
  color: #4c3d91;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
}
.story .down {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ddd6ff;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 700;
}
.story .down svg { width: 16px; height: 16px; }
.story .canvas {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto 28px;
  padding: 28px 22px 36px;
  border-radius: 32px;
  background: var(--paper);
  color: var(--story);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28);
  scroll-margin-top: 88px;
}
.story .flow-head { text-align: center; margin-bottom: 8px; }
.story .flow-head h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2rem); color: var(--story); }
.story .flow-head p { margin: 8px 0 0; color: var(--story-muted); }
.story .tree { display: flex; flex-direction: column; align-items: center; padding-top: 18px; }
.story .node {
  width: min(440px, 100%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: 0 10px 24px rgba(40, 24, 80, .06);
}
.story .node b { font-size: 1rem; font-weight: 700; }
.story .ico {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px; background: #f4f1fb;
}
.story .ico svg { width: 20px; height: 20px; }
.story .stem { width: 2px; height: 36px; background: var(--line); }
.story .decision {
  width: min(380px, 100%);
  justify-content: center;
  text-align: center;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(120deg, #22d3ee, #a78bfa 45%, #fb7185) border-box;
  border: 2px solid transparent;
}
.story .fork { width: 100%; display: grid; gap: 22px; margin-top: 8px; }
.story .branch { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.story .pill {
  padding: 4px 14px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); font-size: .85rem; font-weight: 800;
}
.story .pill.yes { color: #047857; border-color: #6ee7b7; }
.story .pill.no { color: #be123c; border-color: #fda4af; }
.story .c1 { border-color: #67e8f9; }
.story .c2 { border-color: #c4b5fd; }
.story .c3 { border-color: #f9a8d4; }
.story .c4 { border-color: #fcd34d; }
.story .c5 { border-color: #86efac; }
.story .summary {
  margin: 28px 0 0; padding: 18px 20px; border-radius: 18px;
  background: linear-gradient(135deg, #f5f3ff, #ecfeff 55%, #fff1f2);
  border: 1px solid #e4def6; color: var(--story);
  font-size: 1.05rem; font-weight: 600; line-height: 1.9;
}
.story .next { margin: 16px 0 0; color: var(--story-muted); line-height: 1.7; }
.story .canvas .actions { margin-top: 18px; }
@keyframes flow-in {
  from { opacity: 0; transform: translateY(36px); }
  to { opacity: 1; transform: none; }
}
@supports (animation-timeline: view()) {
  .story .step {
    animation: flow-in linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 28%;
  }
  .story .branch .node:nth-child(2) { animation-range: entry 8% cover 34%; }
  .story .branch .node:nth-child(3) { animation-range: entry 16% cover 40%; }
  .story .branch .node:nth-child(4) { animation-range: entry 24% cover 46%; }
}
@media (min-width: 800px) {
  .story .pair { grid-template-columns: 1fr 1fr; }
  .story .pair article + article { border-top: 0; border-inline-start: 1px solid var(--line); }
  .story .fork { grid-template-columns: 1fr 1fr; gap: 28px; }
  .story .canvas { padding: 36px 40px 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .story .pair, .story .step { animation: none; }
}
