/* RankX website. The page is Google's ladder: a 1–20 rail at the inline-start is the navigation,
   each band of it (top 3, 4–10, 11–20, not in top 20) is a section. Tokens follow DESIGN.md. */

:root {
  --rx-ground: #141414; --rx-rail: #0e0e0e; --rx-card: #181818; --rx-raised: #1e1e1e;
  --rx-line: #2c2c2c; --rx-line-strong: #3a3a3a; --rx-ink: #ececec; --rx-ink-2: #a3a3a3; --rx-ink-3: #8f8f8f;
  --rx-green: #3ad17a; --rx-green-ink: #5fc283; --rx-go: #2b7d4b; --rx-go-lit: #308a53; --rx-track: #24452f;
  --rx-ease: cubic-bezier(.16, 1, .3, 1);
  --rx-rail-w: 148px;
  --rx-gutter: clamp(20px, 4.4vw, 64px);
  --rx-font: Raleway, system-ui, sans-serif;
  --rx-num: "RankX Numerals", Raleway, sans-serif;
}
:root:has(body.rx-lang-fa) { --rx-font: Vazirmatn, Tahoma, sans-serif; }
:root:has(body.rx-lang-ar) { --rx-font: Tajawal, Tahoma, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-block-start: 24px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--rx-ground); color: var(--rx-ink); font-family: var(--rx-font); font-size: 1.0625rem; line-height: 1.6; }
body.rx-lang-ar { font-size: 1.125rem; }
::selection { background: var(--rx-go); color: #fff; }
a { color: var(--rx-green-ink); text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--rx-green-ink); outline-offset: 3px; border-radius: 2px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: inherit; text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
.wp-site-blocks { padding: 0; }
.wp-site-blocks > * { margin-block: 0; }

.rx-skip { position: absolute; inset-inline-start: 16px; inset-block-start: -60px; z-index: 50; background: var(--rx-go); color: #fff; padding: 10px 14px; border-radius: 6px; font-weight: 600; text-decoration: none; }
.rx-skip:focus { inset-block-start: 12px; }

/* ---------- Frame: rail | column ---------- */
.rx-frame { display: grid; grid-template-columns: var(--rx-rail-w) minmax(0, 1fr); min-height: 100dvh; }
.rx-frame.is-plain { grid-template-columns: minmax(0, 1fr); }
.rx-column { min-width: 0; display: flex; flex-direction: column; }
.rx-main { flex: 1; }

/* ---------- The ladder rail ---------- */
.rx-rail {
  position: sticky; inset-block-start: 0; block-size: 100dvh; background: var(--rx-rail);
  border-inline-end: 1px solid var(--rx-line); display: flex; flex-direction: column;
  padding: 26px 0 22px; overflow: hidden;
}
.rx-rail .rx-logo { display: block; padding-inline: 24px; margin-block-end: 26px; }
.rx-rail .rx-logo img { display: block; inline-size: 100px; block-size: auto; }
.rx-ladder-nav { position: relative; flex: 1; min-block-size: 0; }
.rx-ladder { list-style: none; margin: 0; padding: 0; block-size: 100%; display: grid; grid-template-rows: 3fr 7fr 10fr auto; position: relative; }
/* the track through the ranked bands */
.rx-ladder::before {
  content: ""; position: absolute; inset-block: 8px 46px; inset-inline-start: 31px; inline-size: 2px; background: var(--rx-track);
}
.rx-band { position: relative; display: flex; flex-direction: column; min-block-size: 0; }
.rx-band-link {
  display: flex; align-items: center; gap: 10px; padding-inline-start: 24px; padding-block: 2px;
  color: var(--rx-ink-2); text-decoration: none; font-weight: 700; font-size: .875rem; line-height: 1.2;
  position: relative; z-index: 1; transition: color .25s var(--rx-ease);
}
.rx-band-link:hover { color: var(--rx-ink); }
.rx-band-name .rx-short { display: none; }
.rx-band-link small { display: block; font-weight: 600; font-size: .75rem; color: var(--rx-ink-3); margin-block-start: 2px; }
.rx-stop {
  flex: none; inline-size: 16px; block-size: 16px; border-radius: 50%; background: var(--rx-rail);
  border: 3px solid var(--rx-green-ink); transition: background-color .25s var(--rx-ease), box-shadow .25s var(--rx-ease);
}
.rx-band.is-out .rx-stop { border-color: var(--rx-line-strong); }
.rx-band.is-out { padding-block-start: 14px; border-block-start: 1px solid var(--rx-line); margin-block-start: 10px; }
.rx-band-link[aria-current="true"] { color: var(--rx-ink); }
.rx-band-link[aria-current="true"] .rx-stop { background: var(--rx-green-ink); box-shadow: 0 0 0 5px rgba(95, 194, 131, .16); }
.rx-rungs { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; justify-content: space-evenly; min-block-size: 0; }
.rx-rung { display: flex; align-items: center; gap: 12px; padding-inline-start: 28px; font: 600 .75rem/1 var(--rx-font); color: #7c7c7c; font-variant-numeric: tabular-nums; }
.rx-rung::before { content: ""; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--rx-line-strong); position: relative; z-index: 1; }
.rx-rung-n { min-inline-size: 1.4em; }
.rx-goal { font-size: .6875rem; color: var(--rx-green); letter-spacing: .02em; }
.rx-rung.is-goal::before { background: var(--rx-green); }
/* "you": the green marker that climbs to the band being read; rail.js sets --rx-you-y */
.rx-you {
  position: absolute; inset-inline-start: 25px; inset-block-start: 0; inline-size: 14px; block-size: 14px; border-radius: 50%;
  background: var(--rx-green); box-shadow: 0 0 0 6px rgba(58, 209, 122, .18); pointer-events: none; opacity: 0; z-index: 2;
  transform: translateY(var(--rx-you-y, 0px));
}
/* the marker is placed without motion; it only glides once the page has loaded (rail.js adds is-placed) */
.rx-rail.is-placed .rx-you { transition: transform .18s linear; }
.rx-rail.is-ready .rx-you { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .rx-rail.is-placed .rx-you { transition: none; } }

/* ---------- Header ---------- */
.rx-header {
  display: flex; align-items: center; justify-content: flex-end; gap: clamp(14px, 2vw, 28px);
  padding: 20px var(--rx-gutter); min-block-size: 76px; font-weight: 600; font-size: .9375rem;
}
.rx-header .rx-logo-small { display: none; margin-inline-end: auto; }
.rx-header .rx-logo-small img { display: block; inline-size: 106px; block-size: auto; }
.rx-langs ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.rx-langs a { display: block; padding: 6px 8px; border-radius: 6px; color: var(--rx-ink-2); text-decoration: none; font-weight: 600; font-size: .875rem; }
.rx-langs a[lang="fa"] { font-family: Vazirmatn, Tahoma, sans-serif; }
.rx-langs a[lang="ar"] { font-family: Tajawal, Tahoma, sans-serif; font-size: .9375rem; }
.rx-langs a[lang="en"] { font-family: Raleway, system-ui, sans-serif; }
.rx-langs a:hover { color: var(--rx-ink); background: var(--rx-raised); }
.rx-langs a[aria-current="true"] { color: var(--rx-ink); }
.rx-signin { color: var(--rx-ink); text-decoration: none; }
.rx-signin:hover { text-decoration: underline; }
.rx-btn, .rx-signup button {
  display: inline-flex; align-items: center; justify-content: center; min-block-size: 40px; padding: 0 18px;
  border: 0; border-radius: 6px; background: var(--rx-go); color: #fff; font: 700 .9375rem/1 var(--rx-font);
  text-decoration: none; cursor: pointer; transition: background-color .2s var(--rx-ease);
}
.rx-btn:hover, .rx-signup button:hover { background: var(--rx-go-lit); }
/* One Go Rule: the sign-up form is the page's one filled green action; the header's copy is quiet */
.rx-header .rx-btn { background: transparent; color: var(--rx-ink); border: 1px solid var(--rx-line-strong); }
.rx-header .rx-btn:hover { background: var(--rx-raised); }
.rx-btn:active, .rx-signup button:active { transform: translateY(1px); }

/* ---------- Shared page rhythm ---------- */
.rx-main > .entry-content, .rx-main .wp-block-post-content { margin: 0; }
.rx-section { padding: clamp(72px, 10vw, 136px) var(--rx-gutter); border-block-start: 1px solid var(--rx-line); }
.rx-section > * { max-inline-size: 1180px; margin-inline: auto; }

/* ---------- Hero: position #1 ---------- */
.rx-hero {
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(32px, 4.5vw, 64px); align-items: start;
  padding: clamp(12px, 2.5vw, 36px) var(--rx-gutter) clamp(64px, 8vw, 112px); max-inline-size: none;
}
.rx-hero > * { margin: 0; max-inline-size: none; }
.rx-hash {
  font-family: var(--rx-num); font-weight: 800; font-size: clamp(5.5rem, 10vw, 9.5rem); line-height: .78;
  color: var(--rx-green); letter-spacing: -.03em; margin-block-end: 28px !important; direction: ltr; text-align: left;
}
[dir="rtl"] .rx-hash { text-align: right; }
.rx-hero h1 { font-size: clamp(2.125rem, 3.3vw, 3.125rem); line-height: 1.08; font-weight: 700; letter-spacing: -.02em; max-inline-size: 17ch; }
body.rx-lang-fa .rx-hero h1, body.rx-lang-ar .rx-hero h1 { letter-spacing: 0; line-height: 1.3; max-inline-size: 17ch; }
.rx-hero h1 mark { background: none; color: var(--rx-green); }
.rx-lede { margin-block-start: 24px !important; font-size: clamp(1.0625rem, 1.3vw, 1.25rem); color: #cfcfcf; max-inline-size: 36em; }
.rx-hero-shot { margin: 0; position: relative; padding-block-start: clamp(8px, 2vw, 28px); }
/* WordPress writes a pixel width on resized images; the column decides instead */
.rx-main .wp-block-image img { inline-size: 100% !important; block-size: auto; }
.rx-hero-shot img { display: block; max-inline-size: 692px; border-radius: 10px; }

/* ---------- Sign-up ---------- */
.rx-signup { display: flex; gap: 10px; margin-block-start: 34px; max-inline-size: 540px; }
.rx-signup label { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rx-signup input {
  flex: 1; min-inline-size: 0; block-size: 54px; padding: 0 16px; border-radius: 6px; border: 1px solid var(--rx-line-strong);
  background: var(--rx-rail); color: var(--rx-ink); font: 400 1.0625rem var(--rx-font); caret-color: var(--rx-green-ink);
  direction: ltr; text-align: start; transition: border-color .2s var(--rx-ease), box-shadow .2s var(--rx-ease);
}
[dir="rtl"] .rx-signup input { text-align: right; }
.rx-signup input::placeholder { color: #7c7c7c; }
.rx-signup input:hover { border-color: #4a4a4a; }
.rx-signup input:focus { outline: none; border-color: var(--rx-green-ink); box-shadow: 0 0 0 3px rgba(95, 194, 131, .18); }
.rx-signup button { block-size: 54px; padding: 0 24px; font-size: 1.0625rem; white-space: nowrap; }
.rx-note { margin-block-start: 12px !important; font-size: .9375rem; color: var(--rx-ink-2); max-inline-size: 36em; }

/* ---------- Bands ---------- */
.rx-band-section { display: grid; grid-template-columns: minmax(150px, 250px) minmax(0, 1fr); gap: 0 clamp(24px, 4vw, 56px); max-inline-size: none; }
.rx-band-section > * { margin: 0; max-inline-size: none; }
.rx-band-num {
  font-family: var(--rx-num); font-weight: 800; font-size: clamp(2.75rem, 4.6vw, 4.5rem); line-height: .9; color: #6b7f72;
  letter-spacing: -.02em; direction: ltr; text-align: end; white-space: nowrap; padding-block-start: 4px;
}
[dir="rtl"] .rx-band-num { text-align: left; }
/* a descending green ramp, every step at least 4.3:1 on the ground */
.rx-band-section.is-top-3 .rx-band-num { color: #3ad17a; }
.rx-band-section.is-top-10 .rx-band-num { color: #45b06f; }
.rx-band-section.is-top-20 .rx-band-num { color: #3a8a5a; }
.rx-band-section.is-start .rx-band-num { color: #6b7f72; }
.rx-band-body { min-inline-size: 0; }
.rx-band-body h2 { font-size: clamp(1.875rem, 3.2vw, 2.75rem); line-height: 1.1; font-weight: 700; letter-spacing: -.018em; max-inline-size: 20ch; }
body.rx-lang-fa .rx-band-body h2, body.rx-lang-ar .rx-band-body h2 { letter-spacing: 0; line-height: 1.35; }
.rx-band-body > p { margin-block-start: 20px; font-size: 1.125rem; color: #cfcfcf; max-inline-size: 38em; }
.rx-facts { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 32px; max-inline-size: 60em; }
.rx-facts li { padding-block: 14px; border-block-start: 1px solid var(--rx-line); color: var(--rx-ink-2); font-size: 1rem; }
.rx-facts strong { display: block; color: var(--rx-ink); font-weight: 700; }
.rx-shots { display: grid; gap: 16px; margin-block-start: 44px; align-items: start; }
.rx-shots.is-pair { grid-template-columns: minmax(0, .82fr) minmax(0, 1.78fr); }
.rx-shots.is-pair.is-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.rx-shots figure { margin: 0; }
.rx-shots img { display: block; inline-size: 100%; border: 1px solid var(--rx-line); border-radius: 10px; }
.rx-shots figcaption, .rx-hero-shot figcaption { margin-block-start: 10px; font-size: .875rem; color: var(--rx-ink-3); }

/* ---------- Start here: not in the top 20 ---------- */
.rx-start { background: linear-gradient(var(--rx-rail), var(--rx-ground) 70%); }
.rx-steps { list-style: none; counter-reset: step; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; position: relative; max-inline-size: 64em; }
.rx-steps::before { content: ""; position: absolute; inset-block-start: 19px; inset-inline: 20px calc(33.33% - 20px); block-size: 2px; background: var(--rx-track); }
.rx-steps li { counter-increment: step; position: relative; padding-inline-end: 28px; color: var(--rx-ink-2); font-size: 1rem; }
.rx-steps li::before {
  content: counter(step); display: grid; place-items: center; inline-size: 40px; block-size: 40px; border-radius: 50%;
  background: var(--rx-ground); border: 3px solid var(--rx-green-ink); color: var(--rx-ink); font: 700 1rem/1 var(--rx-font);
  margin-block-end: 18px; position: relative;
}
.rx-steps li:last-child::before { background: var(--rx-green-ink); color: var(--rx-ground); }
.rx-steps strong { display: block; color: var(--rx-ink); font-size: 1.0625rem; margin-block-end: 4px; }
.rx-start .rx-signup { margin-block-start: 44px; }
.rx-faq { margin-block-start: clamp(56px, 7vw, 88px); max-inline-size: 52em; }
.rx-faq h2 { font-size: 1.5rem !important; }
.rx-faq details { border-block-end: 1px solid var(--rx-line); }
.rx-faq summary { cursor: pointer; list-style: none; padding: 18px 0; font-weight: 700; font-size: 1.0625rem; display: flex; justify-content: space-between; gap: 16px; }
.rx-faq summary::-webkit-details-marker { display: none; }
.rx-faq summary::after {
  content: ""; flex: none; inline-size: 14px; block-size: 14px; margin-block-start: 5px; background: var(--rx-green-ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1v12M1 7h12' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1v12M1 7h12' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .25s var(--rx-ease);
}
.rx-faq details[open] summary::after { transform: rotate(45deg); }
.rx-faq details p { padding-block-end: 18px; color: var(--rx-ink-2); max-inline-size: 44em; }

/* ---------- Footer ---------- */
.rx-footer { border-block-start: 1px solid var(--rx-line); padding: 40px var(--rx-gutter) 48px; font-size: .9375rem; color: var(--rx-ink-2); }
.rx-footer-in { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; max-inline-size: 1180px; margin-inline: auto; }
.rx-footer-mark { flex: none; }
.rx-footer strong { color: var(--rx-ink); font-weight: 700; }
.rx-footer-links { display: flex; gap: 20px; margin-inline-start: auto; }
.rx-footer-links a { color: var(--rx-ink); text-decoration: none; font-weight: 600; }
.rx-footer-links a:hover { text-decoration: underline; }
.rx-copy { inline-size: 100%; font-size: .8125rem; color: var(--rx-ink-3); }

/* ---------- Plain pages (blog, legal) ---------- */
.rx-prose { padding: 32px var(--rx-gutter) 96px; }
.rx-prose h1 { font-size: clamp(2rem, 4vw, 3rem); line-height: 1.12; margin-block: 24px 28px; }
.rx-prose h2 { font-size: 1.625rem; margin-block: 2em .6em; }
.rx-prose p, .rx-prose li { color: #d4d4d4; }
.rx-prose p + p { margin-block-start: 1em; }
.rx-frame.is-plain .rx-header .rx-logo-small { display: block; }

/* ---------- Narrower screens ---------- */
@media (max-width: 1100px) {
  .rx-hero { grid-template-columns: minmax(0, 1fr); }
  .rx-hero-shot { max-inline-size: 760px; }
  .rx-band-section { grid-template-columns: minmax(0, 1fr); }
  .rx-band-num { text-align: start !important; margin-block-end: 18px !important; font-size: 3rem; }
  .rx-shots.is-pair { grid-template-columns: minmax(0, 1fr); }
  .rx-shots.is-pair figure:first-child { max-inline-size: 420px; }
}
/* the rail lies down: a sticky bar of the four bands across the top */
@media (max-width: 860px) {
  .rx-frame { grid-template-columns: minmax(0, 1fr); }
  .rx-rail {
    block-size: auto; inset-block-start: 0; z-index: 20; flex-direction: row; align-items: center; padding: 0; overflow: visible;
    border-inline-end: 0; border-block-end: 1px solid var(--rx-line); background: rgba(14, 14, 14, .96); backdrop-filter: blur(8px);
  }
  .rx-rail .rx-logo, .rx-rungs, .rx-ladder::before, .rx-you { display: none; }
  .rx-ladder-nav { overflow-x: auto; scrollbar-width: none; }
  .rx-ladder { display: flex; gap: 2px; padding: 8px 12px; block-size: auto; }
  .rx-band, .rx-band.is-out { flex: none; padding: 0; margin: 0; border: 0; }
  .rx-band-link { padding: 8px 10px; border-radius: 6px; white-space: nowrap; font-size: .8125rem; }
  .rx-band-link small { display: none; }
  .rx-band-name .rx-long { display: none; }
  .rx-band-name .rx-short { display: inline; }
  .rx-ladder-nav { -webkit-mask-image: linear-gradient(to var(--rx-end, right), #000 85%, transparent); mask-image: linear-gradient(to var(--rx-end, right), #000 85%, transparent); }
  [dir="rtl"] .rx-ladder-nav { --rx-end: left; }
  .rx-stop { inline-size: 12px; block-size: 12px; border-width: 2px; }
  .rx-band-link[aria-current="true"] { background: var(--rx-raised); }
  .rx-header { flex-wrap: wrap; justify-content: flex-start; min-block-size: 0; padding-block: 16px; }
  .rx-header .rx-logo-small { display: block; }
  .rx-langs a { padding-inline: 6px; }
  .rx-signin { display: none; }
  .rx-steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .rx-steps::before { inset-block: 20px 40px; inset-inline-start: 19px; inline-size: 2px; block-size: auto; }
  .rx-steps li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 16px; padding: 0; }
  .rx-steps li::before { grid-row: span 2; margin: 0; }
  .rx-footer-links { margin-inline-start: 0; }
}
@media (max-width: 520px) {
  .rx-header .rx-langs { order: 3; inline-size: 100%; }
  .rx-header .rx-btn { margin-inline-start: auto; }
  .rx-signup { flex-direction: column; }
  .rx-signup input { flex: none; inline-size: 100%; }
  .rx-signup button { inline-size: 100%; }
  .rx-hash { font-size: 5rem; }
}

/* ---------- Band layouts: each band shows its proof its own way ---------- */
/* 1–3: the keyword table, with its three facts as numbered notes beside it */
.rx-annotated { display: grid; grid-template-columns: minmax(0, 1fr) minmax(200px, 250px); gap: 28px; align-items: start; margin-block-start: 44px; }
.rx-annotated figure { margin: 0; }
.rx-annotated img { display: block; inline-size: 100%; border: 1px solid var(--rx-line); border-radius: 10px; }
.rx-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; position: relative; }
.rx-notes::before { content: ""; position: absolute; inset-block: 8px 8px; inset-inline-start: 6px; inline-size: 2px; background: var(--rx-track); }
.rx-notes li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 0 14px; color: var(--rx-ink-2); font-size: .9375rem; line-height: 1.5; }
.rx-notes li::before {
  content: ""; grid-row: span 2; inline-size: 14px; block-size: 14px; margin-block-start: 4px; border-radius: 50%;
  background: var(--rx-ground); border: 3px solid var(--rx-green-ink); position: relative;
}
.rx-notes strong { color: var(--rx-ink); font-size: 1rem; }
/* 4–10: one big competitor picture, its captions sitting under the two charts they explain */
.rx-wide { margin: 44px 0 0; }
.rx-wide img { display: block; inline-size: 100%; border: 1px solid var(--rx-line); border-radius: 10px; }
.rx-chart-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-block-start: 14px; }
.rx-chart-notes p { margin: 0 !important; font-size: .9375rem; color: var(--rx-ink-2); padding-inline: 4px; }
.rx-annotated > *, .rx-split > *, .rx-wide > * { margin-block: 0; }
.rx-chart-notes strong { color: var(--rx-ink); display: block; }
/* 11–20: text and proof side by side, the facts as a short ruled list */
.rx-split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(220px, 1fr); gap: clamp(24px, 3vw, 40px); align-items: start; margin-block-start: 44px; }
.rx-split figure { margin: 0; }
.rx-split img { display: block; inline-size: 100%; border: 1px solid var(--rx-line); border-radius: 10px; }
.rx-split .rx-facts { grid-template-columns: 1fr; margin-block-start: 0; }
@media (max-width: 1100px) {
  .rx-annotated, .rx-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .rx-chart-notes { grid-template-columns: 1fr; }
}
