/* Sahtain source section — matched to sahtain.sa (.source-story)
   Use px (Zid root font is often ~12px). */

:root {
  --sahtain-cyan: #8dd7ff;
  --sahtain-muted: #6c8198;
  --sahtain-navy: #013e87;
  --sahtain-blue: #0072b8;
  --sahtain-sky: #5795e5;
}

.sahtain-source-story,
.sahtain-source-story *,
.sahtain-source-story *::before,
.sahtain-source-story *::after {
  box-sizing: border-box;
}

.sahtain-source-story {
  position: relative;
  min-height: clamp(760px, 92svh, 980px);
  overflow: hidden;
  isolation: isolate;
  background: #061426;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  color: #0b2340;
  width: 100%;
  max-width: none;
}

.source-bg {
  position: absolute;
  inset: 0;
  z-index: -8;
  background-color: #061426;
  background-image: var(--source-bg-desktop, none);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.01);
  transform-origin: center center;
}

.sahtain-source-story.is-empty-bg .source-bg {
  background-image: none;
}

.source-overlay {
  position: absolute;
  inset: 0;
  z-index: -6;
  pointer-events: none;
  opacity: clamp(0, calc(var(--source-overlay-opacity, 100) / 100), 1);
  background:
    radial-gradient(circle at 68% 73%, rgba(87, 149, 229, 0.22), transparent 352px),
    linear-gradient(
      90deg,
      rgba(1, 62, 135, 0.96) 0%,
      rgba(1, 62, 135, 0.86) 24%,
      rgba(0, 114, 184, 0.58) 44%,
      rgba(87, 149, 229, 0.16) 68%,
      rgba(87, 149, 229, 0) 100%
    ),
    linear-gradient(
      rgba(1, 62, 135, 0.08) 0%,
      rgba(0, 114, 184, 0.04) 64%,
      rgba(1, 62, 135, 0.4) 100%
    );
}

.source-pattern {
  position: absolute;
  inset: 0;
  z-index: -4;
  pointer-events: none;
  opacity: 0.025;
  background-size: 270px;
  background-repeat: repeat;
  mix-blend-mode: screen;
}

.source-well-glow {
  position: absolute;
  right: 29.5%;
  top: 34%;
  width: 10px;
  height: 48%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    transparent,
    rgba(78, 193, 255, 0.22),
    rgba(78, 193, 255, 0.06),
    transparent
  );
  filter: blur(8px);
  opacity: 0.55;
}

.source-shell {
  width: min(1420px, calc(100% - 64px));
  min-height: clamp(760px, 92svh, 980px);
  margin: 0 auto;
  position: relative;
}

.source-copy {
  position: absolute;
  left: 0;
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  width: min(600px, 42vw);
  margin: 0;
  padding: 30px var(--source-inset-right, 0px) 30px var(--source-inset-left, 0px);
  text-align: right;
  z-index: 4;
  direction: rtl;
  opacity: 0;
  transform: translateY(calc(-50% + 28px));
}

.source-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--source-kicker-color, var(--sahtain-cyan));
  font-size: var(--source-kicker-size, 13.28px);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: var(--source-kicker-lh, 1.2);
}

.source-kicker::before {
  content: "";
  width: 50px;
  height: 1px;
  background: currentColor;
  opacity: 0.8;
  flex-shrink: 0;
}

.source-title {
  margin: 0;
  max-width: 8.7ch;
  color: var(--source-title-color, rgba(255, 255, 255, 0.65));
  font-family: inherit;
  font-size: clamp(calc(var(--source-title-size, 128px) * 0.525), 6.6vw, var(--source-title-size, 128px));
  line-height: var(--source-title-lh, 0.98);
  letter-spacing: -0.035em;
  font-weight: 300;
  text-wrap: balance;
  text-align: inherit;
}

.source-title strong {
  display: block;
  font-weight: 900;
  color: var(--source-title-strong-color, #fff);
}

.source-desc {
  max-width: 43ch;
  margin: 26px 0 0;
  color: var(--source-desc-color, #fff);
  font-size: clamp(calc(var(--source-desc-size, 18.4px) * 0.8695652174), 1.18vw, var(--source-desc-size, 18.4px));
  line-height: var(--source-desc-lh, 1.95);
  font-weight: 400;
}

.source-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 34px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--source-facts-color, rgba(255, 255, 255, 0.82));
  font-size: var(--source-facts-size, 12.48px);
  font-weight: 700;
  line-height: var(--source-facts-lh, 1.2);
}

.source-facts > span {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-facts i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sahtain-cyan);
  box-shadow: rgba(121, 211, 255, 0.06) 0 0 0 6px;
  flex: 0 0 auto;
  display: block;
}

.source-tech {
  margin-top: 30px;
  color: var(--source-tech-color, #fff);
  font-family: Arial, sans-serif;
  font-size: var(--source-tech-size, 10.88px);
  font-weight: 700;
  line-height: var(--source-tech-lh, 1.4);
  letter-spacing: 0.18em;
  direction: ltr;
  text-align: right;
}

.source-depth-mark {
  position: absolute;
  left: 0;
  right: auto;
  bottom: 8%;
  z-index: 3;
  writing-mode: vertical-rl;
  color: var(--source-depth-color, #eee);
  font-family: Arial, sans-serif;
  font-size: var(--source-depth-size, 10.56px);
  font-weight: 700;
  line-height: var(--source-depth-lh, 1);
  letter-spacing: 0.18em;
  direction: ltr;
  opacity: 0;
  transform: translateY(12px);
}

.sahtain-source-story.is-visible .source-copy {
  animation: sahtainSourceCopyReveal 0.78s cubic-bezier(0.2, 0.78, 0.2, 1) forwards;
}

.sahtain-source-story.is-visible .source-depth-mark {
  animation: sahtainSourceReveal 0.55s ease-out 0.25s forwards;
}

@keyframes sahtainSourceCopyReveal {
  from {
    opacity: 0;
    transform: translateY(calc(-50% + 28px));
  }
  to {
    opacity: 1;
    transform: translateY(-50%);
  }
}

@keyframes sahtainSourceReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* EN */
html[lang="en"] .source-copy,
html[dir="ltr"] .source-copy,
body.ltr .source-copy {
  direction: ltr !important;
  text-align: left !important;
}

html[lang="en"] .source-title,
html[dir="ltr"] .source-title {
  max-width: 14ch !important;
  text-align: left !important;
}

html[lang="en"] .source-desc,
html[dir="ltr"] .source-desc {
  text-align: left !important;
}

html[lang="en"] .source-facts,
html[dir="ltr"] .source-facts {
  direction: ltr !important;
  justify-content: flex-start !important;
}

html[lang="en"] .source-tech,
html[dir="ltr"] .source-tech {
  text-align: left !important;
}

html[lang="en"] .source-kicker::before {
  order: 1;
}

html[lang="en"] .source-kicker {
  flex-direction: row;
}

/* Tablet */
@media (max-width: 980px) {
  .sahtain-source-story {
    min-height: auto;
  }

  .source-shell {
    width: min(calc(100% - 36px), 1000px);
    min-height: 760px;
  }

  .source-copy {
    left: 0;
    right: auto;
    width: min(540px, 50vw);
  }

  .source-title {
    font-size: clamp(calc(var(--source-title-size, 128px) * 0.45), 7.8vw, calc(var(--source-title-size, 128px) * 0.775));
  }
}

/* Mobile */
@media (max-width: 700px) {
  .sahtain-source-story {
    min-height: auto;
    padding-bottom: 54px;
    background: #061426;
  }

  .source-bg {
    inset: 0 0 auto;
    height: 56svh;
    min-height: 410px;
    background-image: var(--source-bg-mobile, var(--source-bg-desktop, none));
    background-size: cover;
    background-position: center center;
    transform: none;
  }

  .source-overlay {
    background: linear-gradient(
      rgba(1, 62, 135, 0) 0%,
      rgba(0, 114, 184, 0.06) 48%,
      rgba(0, 114, 184, 0.52) 62%,
      rgba(1, 62, 135, 0.9) 76%,
      #013e87 100%
    );
  }

  .source-pattern {
    opacity: 0.018;
  }

  .source-well-glow,
  .source-depth-mark {
    display: none;
    line-height: var(--source-depth-lh-m, 1);
  }

  .source-shell {
    width: min(calc(100% - 24px), 760px);
    min-height: auto;
    display: block;
    padding-top: calc(34px + 56svh);
    direction: rtl;
  }

  .source-copy {
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    width: 100%;
    margin: 0;
    padding: 0 var(--source-inset-right-m, 8px) 0 var(--source-inset-left-m, 8px);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
  }

  .sahtain-source-story.is-visible .source-copy {
    animation: sahtainSourceReveal 0.72s cubic-bezier(0.2, 0.78, 0.2, 1) forwards;
  }

  .source-kicker {
    justify-content: center;
    margin-bottom: 14px;
    font-size: var(--source-kicker-size-m, 12.16px);
    line-height: var(--source-kicker-lh-m, 1.2);
  }

  .source-title {
    max-width: 9ch;
    margin-left: auto;
    margin-right: auto;
    font-size: clamp(calc(var(--source-title-size-m, 80px) * 0.68), 14vw, var(--source-title-size-m, 80px));
    line-height: var(--source-title-lh-m, 1.03);
  }

  .source-desc {
    max-width: 31ch;
    margin: 20px auto 0;
    font-size: var(--source-desc-size-m, 14.72px);
    line-height: var(--source-desc-lh-m, 1.8);
  }

  .source-facts {
    justify-content: center;
    gap: 10px 16px;
    margin-top: 26px;
    padding-top: 19px;
    font-size: var(--source-facts-size-m, 11.04px);
    line-height: var(--source-facts-lh-m, 1.2);
  }

  .source-tech {
    margin-top: 24px;
    text-align: center;
    font-size: var(--source-tech-size-m, 9.28px);
    line-height: var(--source-tech-lh-m, 1.4);
  }
}

@media (max-width: 430px) {
  .source-bg {
    height: 54svh;
    min-height: 390px;
    background-position: center center;
  }

  .source-shell {
    padding-top: calc(30px + 54svh);
  }

  .source-title {
    font-size: calc(var(--source-title-size-m, 80px) * 0.72);
  }
}

@media (prefers-reduced-motion: reduce) {
  .source-copy,
  .sahtain-source-story.is-visible .source-copy {
    opacity: 1 !important;
    transform: translateY(-50%) !important;
    animation: none !important;
  }

  .source-depth-mark,
  .sahtain-source-story.is-visible .source-depth-mark {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  @media (max-width: 700px) {
    .source-copy,
    .sahtain-source-story.is-visible .source-copy {
      transform: none !important;
    }
  }
}
