html[lang="fa"] {
  overflow-x: clip;
  font-family: Tahoma, "Segoe UI", "Noto Sans Arabic", "Noto Naskh Arabic UI", Arial, sans-serif;
  line-height: 1.75;
}

.language-entry {
  position: relative;
  display: grid;
  width: min(620px, calc(100% - 36px));
  min-height: 100svh;
  align-content: center;
  justify-items: start;
  gap: 13px;
  margin-inline: auto;
  padding-block: 48px;
}

.language-entry::before {
  position: absolute;
  top: 50%;
  right: 50%;
  width: 540px;
  aspect-ratio: 1;
  border: 1px solid rgba(142, 242, 235, .15);
  border-radius: 50%;
  box-shadow: 0 0 0 36px rgba(113, 127, 205, .035), 0 0 0 76px rgba(113, 127, 205, .025);
  content: "";
  pointer-events: none;
  transform: translate(50%, -50%);
}

.language-entry-instrument {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(142, 242, 235, .32);
  border-radius: 50%;
  color: var(--cyan);
  font-family: var(--serif);
  font-size: 29px;
  box-shadow: 0 0 40px rgba(100, 193, 210, .15), inset 0 0 28px rgba(100, 193, 210, .1);
}

.language-entry > :where(.step-label, h1, p, .language-entry-options) {
  position: relative;
  z-index: 1;
  margin-block: 0;
}

.language-entry h1 {
  max-width: 100%;
  font: 400 clamp(34px, 7vw, 58px)/1.18 var(--serif);
  letter-spacing: -.04em;
}

.language-entry > p:not(.step-label) {
  max-width: 460px;
  color: var(--text-soft);
}

.language-entry-options {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 13px;
}

.language-entry-options .button {
  min-width: 190px;
  justify-content: space-between;
}

.language-option-fa {
  border: 1px solid rgba(142, 242, 235, .25);
  background: rgba(12, 19, 33, .8);
}

html[lang="fa"] .language-entry {
  justify-items: start;
  text-align: right;
}

html[lang="fa"] .language-entry-options {
  flex-direction: row-reverse;
}

html[lang="fa"] body,
html[lang="fa"] #app-shell,
html[lang="fa"] .language-entry {
  direction: rtl;
}

html[lang="fa"] :where(h1, h2, h3, h4, p, label, button, summary, small, dt, dd, li, textarea) {
  letter-spacing: normal;
  overflow-wrap: anywhere;
}

html[lang="fa"] :where(h1, h2, h3, h4) {
  line-height: 1.55;
}

html[lang="fa"] :where(.hero-readout, .instrument-caption, .selection-progress, .spread-count,
  .question-count, .math-observation .value, .math-observation .detail, .record-actions,
  .analysis-metric, .model-state strong) {
  font-variant-numeric: lining-nums tabular-nums;
}

html[lang="fa"] :where([dir="ltr"], .instrument-equation, .reading-cards, .card-grid,
  .analysis-table-scroll, .reproducibility-detail pre, .seed-row input, input[type="number"],
  input[type="text"], .reading-relations) {
  direction: ltr;
  unicode-bidi: isolate;
}

html[lang="fa"] :where(.reading-question, .entry-meaning p, .interpretation-summary p,
  .reading-analysis-prose p, .reading-reflection > p:last-child, .public-information-content p) {
  direction: rtl;
  unicode-bidi: plaintext;
}

html[lang="fa"] .reading-path-list {
  direction: rtl;
}

html[lang="fa"] .reading-step::after {
  right: calc(50% + 34px);
  left: calc(-50% + 34px);
  background: linear-gradient(270deg, rgba(123, 170, 204, .3), rgba(123, 170, 204, .04));
}

html[lang="fa"] .intro::before,
html[lang="fa"] .question-block::before,
html[lang="fa"] .setup-panel::before,
html[lang="fa"] .interpretation-card::before {
  right: 0;
  left: auto;
}

html[lang="fa"] .setup-panel::after {
  right: auto;
  left: 28px;
}

html[lang="fa"] .selection-panel::after {
  right: auto;
  left: -15%;
}

html[lang="fa"] .intro,
html[lang="fa"] .setup-heading,
html[lang="fa"] .spread-heading,
html[lang="fa"] .selection-topline,
html[lang="fa"] .selection-footer,
html[lang="fa"] .reading-header,
html[lang="fa"] .math-heading,
html[lang="fa"] .advanced-button,
html[lang="fa"] .research-mode summary,
html[lang="fa"] .source-detail summary,
html[lang="fa"] .reproducibility-detail summary {
  text-align: right;
}

html[lang="fa"] .spread-hint,
html[lang="fa"] .spread-option-copy,
html[lang="fa"] .advanced-button {
  text-align: right;
}

html[lang="fa"] .spread-option-copy {
  padding-right: 0;
  padding-left: 18px;
}

html[lang="fa"] .spread-select-mark {
  right: auto;
  left: 15px;
}

html[lang="fa"] .research-mode summary::after,
html[lang="fa"] .source-detail summary::after,
html[lang="fa"] .reproducibility-detail summary::after {
  margin-right: auto;
  margin-left: 0;
}

html[lang="fa"] .reading-analysis,
html[lang="fa"] .interpretation-entry,
html[lang="fa"] .reading-reflection,
html[lang="fa"] .reading-analysis-report > .analysis-card {
  border-right: 2px solid rgba(142, 242, 235, .66);
  border-left: 1px solid rgba(148, 192, 223, .17);
  border-radius: var(--radius-s) 0 0 var(--radius-s);
}

html[lang="fa"] .reading-analysis-report > .analysis-card {
  border-right-color: rgba(137, 237, 232, .7);
}

html[lang="fa"] .reading-reflection {
  border-right-color: var(--gold);
  box-shadow: inset -12px 0 24px rgba(229, 196, 125, .035);
}

html[lang="fa"] .reading-overview h3::before,
html[lang="fa"] .reading-card-section > h3::before {
  margin-right: 0;
  margin-left: 12px;
}

html[lang="fa"] .analysis-facts {
  padding-right: 19px;
  padding-left: 0;
}

html[lang="fa"] .analysis-table caption,
html[lang="fa"] .analysis-table th,
html[lang="fa"] .analysis-table td {
  text-align: right;
}

html[lang="fa"] .analysis-table td:dir(ltr),
html[lang="fa"] .analysis-table td[data-technical="true"] {
  text-align: left;
}

html[lang="fa"] .analysis-table-scroll {
  direction: rtl;
}

html[lang="fa"] .selection-panel .card-grid,
html[lang="fa"] .reading-cards.is-celtic,
html[lang="fa"] .reading-cards.is-three {
  direction: ltr;
}

html[lang="fa"] .reading-card,
html[lang="fa"] .card-position,
html[lang="fa"] .orientation-pill,
html[lang="fa"] .interpretation-entry,
html[lang="fa"] .reading-analysis-fact,
html[lang="fa"] .math-observation,
html[lang="fa"] .product-source-list {
  text-align: right;
}

html[lang="fa"] .reading-cards .reading-card {
  direction: rtl;
}

html[lang="fa"] .reading-card-lineup { direction: rtl; }
html[lang="fa"] .reading-card-lineup li { text-align: right; }
html[lang="fa"] .interpretation-summary { max-width: 66ch; font-family: Tahoma, "Segoe UI", Arial, sans-serif; line-height: 2; }
html[lang="fa"] .reading-analysis-prose { font-family: Tahoma, "Segoe UI", Arial, sans-serif; line-height: 1.95; }

html[lang="fa"] .topbar {
  padding-right: 0;
  padding-left: max(28px, calc((100vw - 1320px) / 2));
}

html[lang="fa"] .language-switch {
  direction: ltr;
}

html[lang="fa"] .button-primary::before {
  right: -40%;
  left: auto;
  transform: rotate(-24deg);
}

html[lang="fa"] .selection-progress,
html[lang="fa"] .field-marker,
html[lang="fa"] .brand-name,
html[lang="fa"] .instrument-equation {
  direction: ltr;
  unicode-bidi: isolate;
}

html[lang="fa"] .selection-progress small,
html[lang="fa"] .spread-count,
html[lang="fa"] .instrument-caption,
html[lang="fa"] .instrument-note-math,
html[lang="fa"] .hero-readout small {
  direction: rtl;
  unicode-bidi: isolate;
}

html[lang="fa"] .step-label [data-step-number],
html[lang="fa"] .reading-step [data-step-number],
html[lang="fa"] #question-count,
html[lang="fa"] .selection-progress bdi {
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

html[lang="fa"] .math-observation .value:dir(rtl) {
  text-align: right;
}

html[lang="fa"] .analysis-table td {
  unicode-bidi: plaintext;
}

html[lang="fa"] .selection-progress {
  direction: ltr;
  unicode-bidi: isolate;
}

html[lang="fa"] .public-information-content,
html[lang="fa"] .product-source-group,
html[lang="fa"] .reading-analysis-prose,
html[lang="fa"] .entry-source {
  direction: rtl;
}

html[lang="fa"] .skip-link {
  right: 12px;
  left: auto;
}

html[lang="fa"] .intro-title-primary,
html[lang="fa"] .intro-title-accent {
  display: inline-block;
}

html[lang="fa"] .intro h1 {
  line-height: 1.25;
}

html[lang="fa"] .intro-copy {
  max-width: 590px;
  font-size: 17px;
  line-height: 1.8;
}

@media (max-width: 760px) {
  html[lang="fa"] .intro-copy {
    max-width: 510px;
    font-size: 16px;
    line-height: 1.85;
  }
}

@media (max-width: 420px) {
  html[lang="fa"] .intro-copy {
    max-width: 340px;
  }
}

html[lang="fa"] .instrument-equation {
  top: 190px;
}

@media (max-width: 760px) {
  html[lang="fa"] .reading-analysis-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  html[lang="fa"] .math-observation:nth-child(-n+2) {
    grid-column: 1 / -1;
  }

  html[lang="fa"] .selection-topline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  html[lang="fa"] .selection-topline > div:first-child {
    grid-column: 1 / -1;
  }

  html[lang="fa"] .selection-progress {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }

  html[lang="fa"] #selection-back-button {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }

  html[lang="fa"] .topbar {
    padding-right: max(15px, env(safe-area-inset-right));
    padding-left: max(15px, env(safe-area-inset-left));
  }

  html[lang="fa"] .reading-step::after {
    right: -1px;
    left: 29px;
  }

  html[lang="fa"] .reading-cards.is-three .card-position {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html[lang="fa"] *, html[lang="fa"] *::before, html[lang="fa"] *::after {
    scroll-behavior: auto !important;
  }
}
