/* Rewa Tour — home hero (aurora, flight route, heartbeat, glass stats) */

/* Below-the-fold home sections skip style/layout/paint until they approach the viewport
   (none of them contain fixed-position descendants — keep it that way). */
#main-content > #home ~ section {
  content-visibility: auto;
  contain-intrinsic-size: auto 1000px;
}

.rx-hero {
  --rx-ink: #04232b;
  --rx-deep: #062f39;
  --rx-teal: #0e7490;
  --rx-cyan: #5fd0e0;
  --rx-gold: #e0a44e;
  --rx-text: rgba(226, 244, 247, .82);
  --rx-muted: rgba(226, 244, 247, .6);
  --rx-glass: rgba(255, 255, 255, .07);
  --rx-glass-line: rgba(255, 255, 255, .14);
  --mx: 0;
  --my: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  scroll-margin-top: 80px;
  color: #fff;
  background:
    radial-gradient(1200px 700px at 85% -10%, #0b4f5f 0%, transparent 60%),
    radial-gradient(900px 600px at 0% 110%, #08404c 0%, transparent 60%),
    linear-gradient(165deg, var(--rx-deep) 0%, var(--rx-ink) 70%);
}

/* ── Background layers ───────────────────────────── */
.rx-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.rx-hero__photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .16;
  mix-blend-mode: luminosity;
}

.rx-hero__aurora,
.rx-hero__route,
.rx-float {
  transform: translate3d(calc(var(--mx) * var(--depth-px, 0px)), calc(var(--my) * var(--depth-px, 0px)), 0);
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

/* Sized independently of the hero's content height so late font/JS reflows don't move it (CLS). */
.rx-hero__aurora {
  position: absolute;
  top: -80px;
  inset-inline: -10%;
  height: max(1100px, 130vh);
  filter: blur(60px) saturate(130%);
}

.rx-hero__blob {
  position: absolute;
  border-radius: 50%;
  opacity: .55;
  will-change: transform;
}

.rx-hero__blob--1 {
  width: 46vw; height: 46vw; max-width: 720px; max-height: 720px;
  top: -12%; inset-inline-end: -8%;
  background: radial-gradient(circle at 30% 30%, #0891b2, transparent 65%);
  animation: rxDrift1 22s ease-in-out infinite alternate;
}

.rx-hero__blob--2 {
  width: 38vw; height: 38vw; max-width: 600px; max-height: 600px;
  bottom: -18%; inset-inline-start: -6%;
  background: radial-gradient(circle at 60% 40%, #14b8a6, transparent 65%);
  opacity: .38;
  animation: rxDrift2 26s ease-in-out infinite alternate;
}

.rx-hero__blob--3 {
  width: 26vw; height: 26vw; max-width: 420px; max-height: 420px;
  top: 30%; inset-inline-start: 38%;
  background: radial-gradient(circle, rgba(224, 164, 78, .55), transparent 65%);
  opacity: .28;
  animation: rxDrift3 30s ease-in-out infinite alternate;
}

@keyframes rxDrift1 { to { transform: translate(-8%, 10%) scale(1.12); } }
@keyframes rxDrift2 { to { transform: translate(12%, -8%) scale(1.18); } }
@keyframes rxDrift3 { to { transform: translate(-18%, 14%) scale(.86); } }

.rx-hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%);
}

.rx-hero__route { position: absolute; inset: 0; width: 100%; height: 100%; }
[dir="rtl"] .rx-hero__route { transform-origin: center; scale: -1 1; }

.rx-hero__arc { animation: rxDash 30s linear infinite; }
@keyframes rxDash { to { stroke-dashoffset: -440; } }

.rx-hero__pins circle { fill: var(--rx-cyan); }
.rx-hero__ping {
  fill: none !important;
  stroke: var(--rx-cyan);
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  animation: rxPing 2.8s ease-out infinite;
}
.rx-hero__ping--late { animation-delay: 1.4s; }
@keyframes rxPing { from { transform: scale(1); opacity: .9; } to { transform: scale(6); opacity: 0; } }

.rx-hero__plane { filter: drop-shadow(0 0 6px rgba(95, 208, 224, .9)); }

.rx-hero__ecg {
  stroke-dasharray: 520 2200;
  stroke-dashoffset: 520;
  opacity: .8;
  animation: rxEcg 6s cubic-bezier(.45, 0, .25, 1) infinite;
}
@keyframes rxEcg { to { stroke-dashoffset: -2200; } }

.rx-hero__particles i {
  position: absolute;
  bottom: -10px;
  left: var(--x);
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background: rgba(95, 208, 224, .8);
  box-shadow: 0 0 10px rgba(95, 208, 224, .9);
  animation: rxRise var(--d) linear infinite;
  animation-delay: var(--delay);
}
@keyframes rxRise {
  0% { transform: translateY(0); opacity: 0; }
  10% { opacity: .9; }
  100% { transform: translateY(-110vh); opacity: 0; }
}

.rx-hero__vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 70%, rgba(4, 35, 43, .65) 100%),
    radial-gradient(ellipse at center, transparent 55%, rgba(2, 20, 25, .45) 100%);
}

/* ── Layout ──────────────────────────────────────── */
.rx-hero__inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(48px, 7vw, 96px) 24px clamp(72px, 8vw, 110px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: center;
}

@media (max-width: 991.98px) {
  .rx-hero__inner { grid-template-columns: minmax(0, 1fr); }
}

.rx-hero__content { position: relative; z-index: 2; }

/* ── Entrance ───────────────────────────────────── */
/* Content stays visible from the first paint (fast LCP); only the motion is animated. */
.rx-in {
  animation: rxIn .8s cubic-bezier(.2, .7, .2, 1) backwards;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes rxIn { from { transform: translateY(14px); } }

/* ── Badge ──────────────────────────────────────── */
.rx-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  color: #d8f4f8;
  background: var(--rx-glass);
  border: 1px solid var(--rx-glass-line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.rx-hero__badge i { color: var(--rx-cyan); font-size: 16px; }

.rx-hero__live {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
}
.rx-hero__live::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #34d399;
  animation: rxLive 1.8s ease-out infinite;
}
@keyframes rxLive { to { transform: scale(3); opacity: 0; } }

/* ── Title ──────────────────────────────────────── */
.rx-hero__title {
  margin: 22px 0 18px;
  font-family: 'Tajawal', sans-serif;
  font-weight: 800;
  font-size: clamp(36px, 5.4vw, 66px);
  line-height: 1.12;
  letter-spacing: -.02em;
  color: #fff;
  text-wrap: balance;
}

.rx-hero__lead,
.rx-hero__accent { display: block; }

.rx-hero__accent {
  background: linear-gradient(100deg, #f5c77e 0%, #e0a44e 30%, #5fd0e0 70%, #a5f3fc 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: rxShine 8s ease-in-out infinite alternate;
  padding-bottom: .08em;
}
@keyframes rxShine { to { background-position: 100% 0; } }

.rx-word {
  display: inline-block;
  animation: rxWord .7s cubic-bezier(.2, .7, .2, 1) backwards;
  animation-delay: calc(var(--w) * 60ms);
}
.rx-hero__accent .rx-word {
  background: inherit;
  background-size: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@keyframes rxWord { from { transform: translateY(.35em); } }

.rx-hero__sub {
  max-width: 560px;
  margin: 0 0 22px;
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.85;
  color: var(--rx-text);
}

/* ── Rotating treatments ────────────────────────── */
.rx-hero__rotator {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  font-size: 15px;
  color: var(--rx-muted);
}
.rx-hero__rotator-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.rx-hero__rotator-label i { color: var(--rx-gold); }

.rx-hero__words {
  position: relative;
  display: inline-grid;
  height: 1.9em;
  overflow: hidden;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(95, 208, 224, .1);
  border: 1px solid rgba(95, 208, 224, .25);
}
.rx-hero__words b {
  grid-area: 1 / 1;
  align-self: center;
  white-space: nowrap;
  color: #fff;
  font-weight: 800;
  opacity: 0;
  transform: translateY(100%);
  transition: transform .55s cubic-bezier(.2, .7, .2, 1), opacity .45s;
}
.rx-hero__words b.is-on { opacity: 1; transform: none; }
.rx-hero__words b.is-off { opacity: 0; transform: translateY(-100%); }

/* ── Buttons ────────────────────────────────────── */
.rx-hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.rx-btn {
  --tx: 0px;
  --ty: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  overflow: hidden;
  transform: translate(var(--tx), var(--ty));
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .3s, background .3s, border-color .3s;
}

.rx-btn--primary {
  color: #04232b;
  background: linear-gradient(135deg, #f5c77e, #e0a44e 55%, #d08a2e);
  box-shadow: 0 14px 34px rgba(224, 164, 78, .35), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.rx-btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: rxSweep 3.6s ease-in-out infinite 1.6s;
}
@keyframes rxSweep { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.rx-btn--primary:hover { color: #04232b; box-shadow: 0 18px 44px rgba(224, 164, 78, .5), inset 0 1px 0 rgba(255, 255, 255, .5); }
.rx-btn--primary i { transition: transform .3s; }
.rx-btn--primary:hover i { transform: translateX(-4px); }
[dir="ltr"] .rx-btn--primary:hover i { transform: translateX(4px); }

.rx-btn--ghost {
  color: #fff;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding-inline-start: 12px;
}
.rx-btn--ghost:hover { color: #fff; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .38); }

.rx-btn__play {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--rx-teal);
  font-size: 13px;
}
.rx-btn__play::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .5);
  animation: rxLive 2.4s ease-out infinite;
}

.rx-btn:focus-visible { outline: 2px solid var(--rx-cyan); outline-offset: 3px; }

/* ── Stats ──────────────────────────────────────── */
.rx-hero__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 34px 0 0;
  max-width: 620px;
}
@media (max-width: 575.98px) { .rx-hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.rx-stat {
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
  border: 1px solid var(--rx-glass-line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform .3s, border-color .3s;
}
.rx-stat::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 40%;
  height: 2px;
  background: linear-gradient(90deg, var(--rx-cyan), transparent);
}
[dir="rtl"] .rx-stat::before { background: linear-gradient(270deg, var(--rx-cyan), transparent); }
.rx-stat:hover { transform: translateY(-3px); border-color: rgba(95, 208, 224, .45); }
.rx-stat dt { font-size: 12px; font-weight: 600; color: var(--rx-muted); }
.rx-stat dd {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.rx-stat dd i { color: var(--rx-gold); font-size: .65em; align-self: center; }

/* ── Value chips on dark ────────────────────────── */
.rx-hero .rx-hero__values { margin-top: 18px; }
.rx-hero .rewa-values__item {
  color: #d8f4f8;
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .12);
}
.rx-hero .rewa-values__item i { color: var(--rx-cyan); }
.rx-hero .rewa-values__item:hover { background: rgba(255, 255, 255, .12); border-color: rgba(95, 208, 224, .5); color: #fff; }

/* ── Quote card & floating cards ────────────────── */
.rx-hero .rewa-quote {
  z-index: 2;
  box-shadow: 0 40px 90px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 255, 255, .08);
}

.rx-float {
  position: absolute;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(8, 44, 53, .72);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
  animation: rxBob 6s ease-in-out infinite;
}
.rx-float--doctors { top: 12%; inset-inline-end: calc(46% - 70px); }
.rx-float--reply { bottom: 14%; inset-inline-end: -6px; animation-delay: -3s; }
@keyframes rxBob { 50% { translate: 0 -10px; } }

.rx-float__avatars { display: flex; }
.rx-float__avatars img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #0b3a45;
  background: #e8f3fb;
  margin-inline-start: -10px;
}
.rx-float__avatars img:first-child { margin-inline-start: 0; }

.rx-float__icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 18px;
  color: #04232b;
  background: linear-gradient(135deg, #a5f3fc, var(--rx-cyan));
}

.rx-float__text { display: flex; flex-direction: column; line-height: 1.35; }
.rx-float__text b { font-size: 13px; color: #fff; }
.rx-float__text small { font-size: 11.5px; color: var(--rx-muted); }

@media (max-width: 1199.98px) { .rx-float { display: none; } }

/* ── Scroll cue ─────────────────────────────────── */
.rx-hero__scroll {
  position: absolute;
  bottom: 48px;
  left: 50%;
  translate: -50% 0;
  width: 26px;
  height: 42px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, .35);
  display: flex;
  justify-content: center;
  padding-top: 8px;
}
.rx-hero__scroll span {
  width: 3px;
  height: 8px;
  border-radius: 3px;
  background: #fff;
  animation: rxScroll 1.8s ease-in-out infinite;
}
@keyframes rxScroll { 0% { transform: translateY(0); opacity: 1; } 80%, 100% { transform: translateY(14px); opacity: 0; } }
@media (max-width: 991.98px) { .rx-hero__scroll { display: none; } }

/* ── Reduced motion ─────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .rx-hero *,
  .rx-hero *::before,
  .rx-hero *::after {
    animation: none !important;
    transition: none !important;
  }
  .rx-in, .rx-word { opacity: 1 !important; transform: none !important; filter: none !important; }
  .rx-hero__plane, .rx-hero__particles { display: none; }
  .rx-hero__ecg { stroke-dasharray: none; stroke-dashoffset: 0; }
}
