/* CHERT Research — additions on top of the shared CHERT site styles (site.css, shell.css), the same way
   chertfleet.css and cherttt.css extend them. Only what this site has and the others do not: the research
   card in the hero, the one-research projection diagram, the standards grid, capabilities, services,
   the screenshot gallery, the open-stack inventory, the roadmap, the simple-page band, and RTL.

   Tokens only (chert-tokens.css); tints via color-mix. Logical properties only.
   RTL (design system §7): unlike the sister sites, Arabic here is dir="rtl". The shared stylesheets set a
   few physical values; they are re-expressed logically below. Diagrams whose geometry is absolute (the
   layer stack, the lifecycle wheel, the projection hub) are rendered dir="ltr" and never mirror. */

/* ------------------------------------------------------------- RTL base --- */
.sx { text-align: start; }
.sx-node { text-align: start; }
[dir="rtl"] .rs-dir svg { transform: scaleX(-1); }            /* arrows and chevrons mirror (§7.2) */
[dir="rtl"] .sx-btn-ghost svg, [dir="rtl"] .sx-jbtn svg { transform: none; } /* play stays ▶ */
[lang="ar"] .sx-eyebrow { text-transform: none; letter-spacing: normal; }
[lang="ar"] .sx-nav__links a, [lang="ar"] .sx-nav__actions a, [lang="ar"] .btn, [lang="ar"] .sx-btn-ghost,
[lang="ar"] .sx-jbtn, [lang="ar"] .sx-foot__links a { unicode-bidi: plaintext; }

/* The shared skip link parks itself at left:-9999px, which under dir=rtl widens the page. Park it above instead. */
.skip-link, .skip-link:focus { left: auto; inset-inline-start: 0; }
.skip-link { translate: 0 -120%; }
.skip-link:focus { translate: none; }

/* ------------------------------------------------------------ session --- */
.rs-session { display: inline-flex; align-items: center; gap: var(--space-4); }
.sx-nav__links a, .rs-session a { white-space: nowrap; }
@media (max-width: 1240px) { .rs-session__user { display: none; } }
.rs-session__user { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .rs-session { gap: var(--space-2); } }

/* ------------------------------------------------- hero: research card --- */
.rs-card { position: absolute; right: 0; bottom: calc(-128 * var(--u)); width: calc(262 * var(--u)); padding: 14px 16px; border-radius: var(--radius-card);
  border: 1px solid var(--chert-dark-border); background: color-mix(in srgb, var(--chert-dark-surface) 84%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--shadow-modal); animation: sx-float 7s ease-in-out infinite;
  text-align: start; color: var(--chert-dark-text); }
.rs-card__head { display: flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--chert-dark-muted); }
.rs-card__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chert-orange); animation: sx-blink 1.6s ease-in-out infinite; }
.rs-card__tag { margin-inline-start: auto; font-family: var(--font-ui); font-size: 10.5px; padding: 1px 7px; border-radius: var(--radius-pill); border: 1px solid var(--chert-dark-border); }
[lang="ar"] .rs-card__tag { font-family: var(--font-ar); }
.rs-card__title { margin: 10px 0 0; font-size: 13.5px; font-weight: 700; line-height: 1.35; color: var(--chert-dark-text); }
.rs-card__steps { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 7px; }
.rs-card__steps li { position: relative; padding-inline-start: 22px; font-size: 12.5px; color: var(--chert-dark-muted); }
.rs-card__steps li::before { content: ""; position: absolute; inset-inline-start: 0; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; border: 1.5px solid var(--chert-dark-border); }
.rs-card__steps li.is-done { color: var(--chert-dark-text); }
.rs-card__steps li.is-done::before { background: var(--chert-success); border-color: var(--chert-success); }
.rs-card__steps li.is-now { color: var(--chert-dark-text); font-weight: 700; }
.rs-card__steps li.is-now::before { border-color: var(--chert-orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--chert-orange) 25%, transparent); animation: sx-blink 1.6s ease-in-out infinite; }
.rs-card__doi { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--chert-dark-border); color: var(--chert-dark-muted); font-size: 12px; }
.rs-card__doi b { font-family: var(--font-mono); font-size: 12.5px; color: var(--chert-orange); font-weight: 600; }
.rs-card__foot { margin-top: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--chert-dark-muted); }
[lang="ar"] .rs-card__foot { font-family: var(--font-ar); }
[lang="ar"] .rs-card__steps li, [lang="ar"] .rs-card__title { line-height: 1.5; }
@media (max-width: 760px) { .rs-card { display: none; } }

/* ------------------------------------------------------------- doors --- */
.rs-doors { background: var(--chert-surface-alt); }

/* ------------------------------------------- projection: one research --- */
.rs-proj { background: var(--chert-cream); }
.rs-proj__stage { position: relative; max-width: 980px; margin: 0 auto; aspect-ratio: 16 / 10; }
.rs-proj__wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rs-proj__wires line { stroke: color-mix(in srgb, var(--chert-orange) 55%, var(--chert-border)); stroke-width: 1.5; vector-effect: non-scaling-stroke;
  stroke-dasharray: 4 6; animation: rs-flow 1.6s linear infinite; animation-delay: calc(var(--k) * -0.18s); }
@keyframes rs-flow { to { stroke-dashoffset: -20; } }
.rs-proj__hub { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 1; width: clamp(150px, 22%, 210px); aspect-ratio: 1; border-radius: 50%;
  display: grid; place-content: center; justify-items: center; gap: 4px; padding: 18px; text-align: center; color: var(--chert-dark-text);
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--chert-orange) 30%, var(--chert-dark)), var(--chert-dark));
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--chert-orange) 12%, transparent), 0 0 0 22px color-mix(in srgb, var(--chert-orange) 6%, transparent), var(--shadow-modal); }
.rs-proj__hub-icon { color: var(--chert-orange); }
.rs-proj__hub b { font-size: 19px; line-height: 1.2; }
.rs-proj__hub small { font-size: 11.5px; color: var(--chert-dark-muted); line-height: 1.35; }
.rs-proj__spokes { list-style: none; margin: 0; padding: 0; }
.rs-spoke { position: absolute; left: var(--x); top: var(--y); translate: -50% -50%; z-index: 2; display: flex; align-items: center; gap: 10px;
  min-width: 168px; padding: 10px 14px 10px 10px; border-radius: 14px; border: 1px solid var(--chert-border); background: var(--chert-surface);
  box-shadow: var(--shadow-card); transition: translate var(--dur-slow) var(--ease), border-color var(--dur-slow), opacity .8s var(--ease), transform .8s var(--ease); }
.js .rs-spoke.sx-reveal { transition-delay: 0s, 0s, calc(var(--k) * 70ms), calc(var(--k) * 70ms); }
.rs-spoke:hover { border-color: var(--chert-orange); }
.rs-spoke__icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--chert-orange); background: var(--chert-ink); }
.rs-spoke__txt { display: grid; line-height: 1.25; text-align: start; }
.rs-spoke__txt b { font-size: 14px; }
.rs-spoke__txt small { font-size: 12.5px; color: var(--chert-muted); }
@media (max-width: 860px) {
  .rs-proj__stage { aspect-ratio: auto; display: grid; gap: 18px; justify-items: center; }
  .rs-proj__wires { display: none; }
  .rs-proj__hub { position: static; translate: none; width: 190px; }
  .rs-proj__spokes { width: 100%; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
  .rs-spoke { position: static; translate: none; min-width: 0; }
}

/* --------------------------------------------------------- standards --- */
.rs-std { background: var(--chert-surface-alt); }
.rs-std__grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.rs-rule { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 16px; border: 1px solid var(--chert-border); background: var(--chert-surface);
  transition: translate var(--dur-slow) var(--ease), box-shadow var(--dur-slow), border-color var(--dur-slow), opacity .8s var(--ease), transform .8s var(--ease); }
.js .rs-rule.sx-reveal { transition-delay: 0s, 0s, 0s, calc(var(--k, 0) * 60ms), calc(var(--k, 0) * 60ms); }
.rs-rule:hover { translate: 0 -3px; box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--chert-orange) 50%, var(--chert-border)); }
.rs-rule__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rs-rule__icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--chert-orange); background: var(--chert-ink); }
.rs-rule h3 { margin: 4px 0 0; font-size: 16px; line-height: 1.3; }
.rs-rule p { margin: 0; font-size: 13px; color: var(--chert-muted); line-height: 1.4; }
.rs-rule p b { color: var(--chert-ink); font-weight: 600; }
.rs-rule p span::after { content: ":"; }
.rs-level { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: var(--radius-pill); }
.rs-level--required { color: var(--chert-ink); background: color-mix(in srgb, var(--chert-orange) 30%, var(--chert-surface)); }
.rs-level--recommended { color: var(--chert-info); background: var(--chert-info-tint); }
.rs-std__cond { margin-top: auto; font-size: 12px; color: var(--chert-muted); font-style: italic; }
[lang="ar"] .rs-std__cond { font-style: normal; }
.rs-std__note { max-width: 760px; margin: var(--space-6) auto 0; text-align: center; font-size: 13px; color: var(--chert-muted); }

/* ------------------------------------------------------ capabilities --- */
.rs-caps { background: var(--chert-cream); }
.rs-caps__grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.rs-cap { display: flex; flex-direction: column; padding: 22px 22px 18px; border-radius: 18px; border: 1px solid var(--chert-border); background: var(--chert-surface);
  transition: translate var(--dur-slow) var(--ease), box-shadow var(--dur-slow), border-color var(--dur-slow), opacity .8s var(--ease), transform .8s var(--ease); }
.js .rs-cap.sx-reveal { transition-delay: 0s, 0s, 0s, calc(var(--k, 0) * 60ms), calc(var(--k, 0) * 60ms); }
.rs-cap:hover { translate: 0 -3px; box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--chert-orange) 50%, var(--chert-border)); }
.rs-cap__top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rs-cap__top .sx-pillar__icon { margin: 0; flex: none; }
.rs-cap h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.rs-cap ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.rs-cap li { position: relative; padding-inline-start: 18px; font-size: 14.5px; color: var(--chert-muted); line-height: 1.45; }
.rs-cap li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .55em; width: 7px; height: 7px; border-radius: 2px; background: var(--chert-orange); transform: rotate(45deg); }
[lang="ar"] .rs-cap li { line-height: var(--lh-ar); }

/* ---------------------------------------------------------- services --- */
.rs-services { background: var(--chert-surface-alt); }
.rs-services__grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.rs-svc { position: relative; display: flex; flex-direction: column; padding: 26px; border-radius: 20px; border: 1px solid var(--chert-border); background: var(--chert-surface);
  transition: translate var(--dur-slow) var(--ease), box-shadow var(--dur-slow), border-color var(--dur-slow), opacity .8s var(--ease), transform .8s var(--ease); }
.js .rs-svc.sx-reveal { transition-delay: calc(var(--k, 0) * 90ms), 0s, 0s, calc(var(--k, 0) * 90ms), calc(var(--k, 0) * 90ms); }
.rs-svc:hover { translate: 0 -4px; box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--chert-orange) 50%, var(--chert-border)); }
.rs-svc__kicker { margin: 18px 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--chert-muted); }
[lang="ar"] .rs-svc__kicker { letter-spacing: normal; font-size: 13px; text-transform: none; }
.rs-svc h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.25; }
.rs-svc p:not(.rs-svc__kicker) { margin: 0 0 14px; color: var(--chert-muted); }
.rs-svc__link { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12.5px; color: var(--chert-ink); text-decoration: none; }
a.rs-svc__link:hover { text-decoration: underline; text-decoration-color: var(--chert-orange-deep); text-underline-offset: 3px; }
span.rs-svc__link { color: var(--chert-muted); }

/* ----------------------------------------------------------- gallery --- */
.rs-gallery { color: var(--chert-dark-text); background:
  radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--chert-orange) 14%, transparent), transparent 70%), var(--chert-dark); }
.rs-gallery .sx-eyebrow { color: var(--chert-orange); }
.rs-gallery__grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.rs-shot { margin: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--chert-dark-border); background: var(--chert-dark-surface); box-shadow: var(--shadow-modal);
  transition: translate var(--dur-slow) var(--ease), border-color var(--dur-slow), opacity .8s var(--ease), transform .8s var(--ease); }
.js .rs-shot.sx-reveal { transition-delay: 0s, 0s, calc(var(--k, 0) * 110ms), calc(var(--k, 0) * 110ms); }
.rs-shot:hover { translate: 0 -4px; border-color: color-mix(in srgb, var(--chert-orange) 55%, var(--chert-dark-border)); }
.rs-shot__frame { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--chert-dark-border); }
.rs-shot__frame span { width: 9px; height: 9px; border-radius: 50%; background: var(--chert-dark-border); }
.rs-shot img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }
.rs-shot figcaption { padding: 12px 16px 14px; font-size: 14px; color: var(--chert-dark-muted); }

/* -------------------------------------------------------- open stack --- */
.rs-stack { background: var(--chert-cream); }
.rs-layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.rs-layer { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 18px; border: 1px solid var(--chert-border); background: var(--chert-surface); }
@media (min-width: 1000px) { .rs-layers { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rs-layer--researcher { grid-column: 1 / -1; border-color: var(--chert-orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--chert-orange) 14%, transparent); }
.rs-layer__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rs-layer h3 { margin: 0; font-size: 19px; }
.rs-layer__count { font-size: 13px; color: var(--chert-muted); white-space: nowrap; }
.rs-layer__count span { font-weight: 800; color: var(--chert-ink); }
.rs-layer__kind { align-self: flex-start; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: var(--radius-pill); color: var(--chert-ink); background: var(--chert-surface-alt); border: 1px solid var(--chert-border); }
.rs-layer--researcher .rs-layer__kind { background: color-mix(in srgb, var(--chert-orange) 30%, var(--chert-surface)); border-color: transparent; }
.rs-layer > p { margin: 0; color: var(--chert-muted); font-size: 14.5px; }
.rs-techs { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.tech { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 12px; border-radius: 12px; background: var(--chert-surface-alt); border: 1px solid var(--chert-border); }
.tech > span.ltr { font-weight: 700; font-size: 14px; }
.tech > small { font-family: var(--font-mono); font-size: 11px; color: var(--chert-muted); align-self: center; }
.tech-role { grid-column: 1 / -1; font-size: 12.5px; color: var(--chert-muted); line-height: 1.35; }
.rs-stack__foot { margin: var(--space-6) 0 0; text-align: center; font-size: 13px; color: var(--chert-muted); }

/* ------------------------------------------------------------- why --- */
.rs-why { background: var(--chert-surface-alt); }

/* --------------------------------------------------------- roadmap --- */
.rs-road { background: var(--chert-cream); padding-bottom: var(--space-9); }
.rs-road__items { list-style: none; margin: 0 auto; padding: 0; max-width: 860px; display: grid; gap: 12px; }
.rs-road__item { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 16px; border: 1px dashed var(--chert-border); background: var(--chert-surface); }
.rs-road__icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--chert-muted); background: var(--chert-surface-alt); }
.rs-road__item div { display: grid; gap: 2px; }
.rs-road__item b { font-size: 16px; }
.rs-road__item small { font-size: 14px; color: var(--chert-muted); }
.rs-road__state { margin-inline-start: auto; flex: none; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill); color: var(--chert-ink); background: var(--chert-warning-tint); }
@media (max-width: 600px) { .rs-road__item { flex-wrap: wrap; } .rs-road__state { margin-inline-start: 56px; } }

/* ------------------------------------------------ simple pages (legal, 404) --- */
.sx.rs-page { background: var(--chert-dark); }
.rs-band { padding: calc(var(--header-h) + var(--space-9)) 0 var(--space-9); color: var(--chert-dark-text); background:
  radial-gradient(60% 80% at 80% 0%, color-mix(in srgb, var(--chert-orange) 16%, transparent), transparent 70%), var(--chert-dark); min-height: 60vh; }
.rs-band__inner { max-width: 760px; }
.rs-band h1 { margin: 0 0 var(--space-5); font-size: clamp(32px, 4vw, 48px); line-height: 1.1; }
.rs-band p { color: var(--chert-dark-muted); font-size: 17px; line-height: 1.6; }
[lang="ar"] .rs-band p { line-height: var(--lh-ar); }
.rs-band a:not(.btn) { color: var(--chert-orange); }

/* ---------------------------------------------------------- footer --- */
.rs-foot__brand { display: grid; gap: 6px; }
.rs-foot__brand p { margin: 0; font-size: 13px; color: var(--chert-dark-muted); }
.rs-foot__copy { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: var(--space-5); padding-top: var(--space-4);
  border-top: 1px solid var(--chert-dark-border); font-size: 12.5px; color: var(--chert-dark-muted); }
