:root {
  --ink: #f4f7fb;
  --muted: #b7c3d4;
  --navy: #0b1c33;
  --navy-2: #12304f;
  --blue: #2f7de1;
  --blue-deep: #1a4f9c;
  --sand: #e8c27a;
  --aqua: #7ff7e7;
  --line: rgba(244, 247, 251, 0.14);
  --panel: rgba(255, 255, 255, 0.05);
  --panel-hover: rgba(255, 255, 255, 0.1);
  --dropdown-bg: rgba(11, 28, 51, 0.96);
  --shadow: 0 28px 80px rgba(4, 12, 24, 0.45);
  --font: "Manrope", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --fa: "Vazirmatn", "Manrope", sans-serif;
  --body-bg:
    radial-gradient(1200px 600px at 10% -10%, rgba(47, 125, 225, 0.28), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(232, 194, 122, 0.16), transparent 50%),
    linear-gradient(165deg, #071525 0%, var(--navy) 42%, #0e2742 100%);
  --hero-shade:
    linear-gradient(90deg, rgba(7, 21, 37, 0.88) 0%, rgba(7, 21, 37, 0.55) 42%, rgba(7, 21, 37, 0.2) 100%),
    linear-gradient(180deg, rgba(7, 21, 37, 0.15) 0%, rgba(7, 21, 37, 0.75) 70%, rgba(7, 21, 37, 0.95) 100%);
  --store-bg: rgba(255, 255, 255, 0.04);
  --store-border: rgba(244, 247, 251, 0.12);
}

html.light {
  --ink: #0f172a;
  --muted: #475569;
  --navy: #f8fafc;
  --navy-2: #e2e8f0;
  --blue: #1d4ed8;
  --blue-deep: #1e3a8a;
  --sand: #d97706;
  --aqua: #0d9488;
  --line: rgba(15, 23, 42, 0.12);
  --panel: rgba(15, 23, 42, 0.04);
  --panel-hover: rgba(15, 23, 42, 0.08);
  --dropdown-bg: rgba(248, 250, 252, 0.98);
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  --body-bg:
    radial-gradient(1200px 600px at 10% -10%, rgba(29, 78, 216, 0.1), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(217, 119, 6, 0.08), transparent 50%),
    linear-gradient(165deg, #f8fafc 0%, #f1f5f9 42%, #e2e8f0 100%);
  --hero-shade:
    linear-gradient(90deg, rgba(248, 250, 252, 0.92) 0%, rgba(248, 250, 252, 0.62) 42%, rgba(248, 250, 252, 0.2) 100%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.2) 0%, rgba(248, 250, 252, 0.72) 70%, rgba(241, 245, 249, 0.95) 100%);
  --store-bg: rgba(255, 255, 255, 0.72);
  --store-border: rgba(15, 23, 42, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  background: var(--body-bg);
}

body[dir="rtl"] {
  font-family: var(--fa);
}

body[dir="rtl"] .hero-copy h1,
body[dir="rtl"] .section-head h2 {
  font-family: var(--fa);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  color: #000;
  padding: 0.5rem 0.75rem;
  z-index: 50;
}

.skip:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--navy) 78%, transparent);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--ink);
}

.lang-wrap {
  position: relative;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 0.75rem;
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ctrl-btn:hover {
  background: var(--panel-hover);
}

.ctrl-btn svg {
  color: var(--aqua);
  flex-shrink: 0;
}

.lang-btn .lang-chevron {
  color: var(--muted);
  transition: transform 0.2s ease;
}

.lang-btn.is-open .lang-chevron {
  transform: rotate(180deg);
}

.theme-btn {
  padding: 0.55rem;
}

.lang-dropdown {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 0.5rem);
  z-index: 60;
  min-width: 10rem;
  padding: 0.35rem 0;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: var(--dropdown-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: scale(0.96);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

html[dir="rtl"] .lang-dropdown {
  transform-origin: top left;
}

.lang-dropdown.is-open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: start;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  direction: ltr;
}

.lang-option:hover,
.lang-option[aria-selected="true"] {
  background: var(--panel-hover);
  color: var(--ink);
}

.lang-option .lang-option-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}

.lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  direction: ltr;
  unicode-bidi: isolate;
}

.lang-flag--dual {
  width: 2.55rem;
  gap: 0.15rem;
}

.lang-flag img {
  display: block;
  width: 1.25rem;
  height: 0.75rem;
  object-fit: cover;
  object-position: center;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.lang-flag span {
  font-size: 1rem;
  line-height: 1.25rem;
}

#current-lang-flags {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.hero {
  position: relative;
  min-height: min(92vh, 920px);
  display: grid;
  align-items: end;
}

.hero-media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.02);
  animation: drift 18s ease-in-out infinite alternate;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: var(--hero-shade);
}

.hero-copy {
  position: relative;
  z-index: 1;
  padding: clamp(2rem, 8vh, 5rem) clamp(1rem, 4vw, 2.5rem) clamp(2.5rem, 7vh, 4rem);
  max-width: 42rem;
  animation: rise 0.9s ease both;
}

.eyebrow {
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sand);
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.lede {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  line-height: 1.55;
  max-width: 34rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-deep));
  color: #fff;
  box-shadow: 0 12px 30px rgba(47, 125, 225, 0.35);
}

.btn.ghost {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.note {
  margin: 1rem 0 0;
  color: rgba(183, 195, 212, 0.85);
  font-size: 0.9rem;
}

.section {
  padding: clamp(3rem, 8vh, 5rem) clamp(1rem, 4vw, 2.5rem);
}

.section-head {
  max-width: 40rem;
  margin-bottom: 2rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 0.75rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.download {
  background: linear-gradient(180deg, rgba(18, 48, 79, 0.35), transparent);
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.store {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1rem 1.1rem;
  border-radius: 1.1rem;
  border: 1px solid var(--store-border);
  background: var(--store-bg);
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.store:hover {
  transform: translateY(-3px);
  border-color: rgba(47, 125, 225, 0.45);
  background: rgba(47, 125, 225, 0.08);
}

.store img:not(.badge) {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.store .badge {
  width: auto;
  height: 36px;
}

.store strong {
  display: block;
  font-size: 1rem;
}

.store span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.fine {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.fine code {
  font-size: 0.85em;
  color: var(--sand);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: grid;
  gap: 0.35rem;
  padding: 1.15rem 1.2rem 1.15rem 4.2rem;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.03);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 1.1rem;
  top: 1.15rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(47, 125, 225, 0.2);
  color: #d7e7ff;
  font-weight: 800;
}

body[dir="rtl"] .steps li {
  padding: 1.15rem 4.2rem 1.15rem 1.2rem;
}

body[dir="rtl"] .steps li::before {
  left: auto;
  right: 1.1rem;
}

.steps strong {
  font-size: 1.05rem;
}

.steps span {
  color: var(--muted);
  line-height: 1.5;
}

.page-downloads .downloads-main {
  width: min(920px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.5rem, 8vh, 4.5rem) 0 3rem;
  animation: rise 0.7s ease both;
}

.page-downloads .downloads-head {
  margin-bottom: 2rem;
}

.page-downloads .downloads-head h1 {
  margin: 0.35rem 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-downloads .eyebrow {
  margin: 0;
  color: var(--sand);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-downloads .store[aria-disabled="true"] {
  cursor: default;
  opacity: 0.78;
}

.page-downloads .store:target {
  outline: 2px solid rgba(47, 125, 225, 0.7);
  outline-offset: 3px;
}

.foot {
  padding: 2rem clamp(1rem, 4vw, 2.5rem) 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  font-size: 0.92rem;
}

.foot p {
  margin: 0;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: scale(1.02) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.06) translate3d(-1.2%, -0.8%, 0);
  }
}

@media (max-width: 720px) {
  .nav a {
    display: none;
  }

  .hero {
    min-height: 84vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
