/* ═══════════════════════════════════════════════════════════
   KORSHOM v2 — shared building blocks (every page)
   Layout, type, buttons, reveals, spotlight, closing CTA.
   ═══════════════════════════════════════════════════════════ */


.kx-home {
  background: var(--kx-bg);
  color: var(--kx-fg);
  font-family: var(--kx-body);
  overflow-x: clip;
}
.kx-home *,
.kx-home *::before,
.kx-home *::after { box-sizing: border-box; }
.kx-home img { max-width: none; }
.kx-home ul,
.kx-home ol { list-style: none; margin: 0; padding: 0; }
.kx-home a { text-decoration: none; color: inherit; }
.kx-home button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.kx-wrap {
  width: min(1320px, 100% - 2 * clamp(16px, 4vw, 56px));
  margin-inline: auto;
}

.kx-section {
  position: relative;
  padding-block: clamp(88px, 11vw, 168px);
}

/* ── Type primitives ───────────────────────────────── */
.kx-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--kx-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--kx-accent);
  margin-bottom: 22px;
}
.kx-eyebrow i {
  width: 34px;
  height: 1px;
  background: currentColor;
  position: relative;
}
.kx-eyebrow i::after {
  content: '';
  position: absolute;
  inset-inline-end: -3px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--kx-volt);
  box-shadow: 0 0 12px var(--kx-volt);
}
html[lang^="ar"] .kx-eyebrow { font-family: var(--kx-body); letter-spacing: 0; font-size: 0.95rem; font-weight: 700; }

.kx-title {
  font-family: var(--kx-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 5.4vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--kx-fg);
  margin: 0;
  text-wrap: balance;
}
.kx-title--sm { font-size: clamp(2rem, 3.6vw, 3.4rem); }
html[lang^="ar"] .kx-title { letter-spacing: 0; line-height: 1.25; font-weight: 700; }

.kx-desc {
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.75;
  color: var(--kx-muted);
  max-width: 52ch;
  margin: 0;
}

.kx-head { margin-bottom: clamp(48px, 6vw, 88px); }
.kx-head--split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
}
.kx-head--split > :first-child { max-width: 760px; }
.kx-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  max-width: 420px;
}
.kx-head--center { text-align: center; }
.kx-head--center .kx-title { margin-inline: auto; max-width: 18ch; }

/* ── Buttons ───────────────────────────────────────── */
.kx-home .kx-btn {
  --bg: transparent;
  --fg: var(--kx-fg);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 58px;
  padding: 0 10px 0 28px;
  padding-inline: 28px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--kx-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: color 0.45s var(--kx-ease), border-color 0.45s, transform 0.2s;
  will-change: transform;
}
.kx-home .kx-btn::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: var(--hover-bg, #fff);
  transform: translateY(101%);
  transition: transform 0.55s var(--kx-ease);
}
.kx-home .kx-btn:hover::before { transform: translateY(0); }
.kx-home .kx-btn-arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--kx-ink);
  color: var(--kx-volt);
  font-size: 1.05rem;
  transition: transform 0.5s var(--kx-ease), background 0.4s, color 0.4s;
}
html[dir="rtl"] .kx-home .kx-btn-arrow { transform: scaleX(-1); }
.kx-home .kx-btn:hover .kx-btn-arrow { transform: rotate(45deg); }
html[dir="rtl"] .kx-home .kx-btn:hover .kx-btn-arrow { transform: scaleX(-1) rotate(45deg); }

.kx-home .kx-btn--volt {
  --bg: var(--kx-volt);
  --fg: var(--kx-ink);
  box-shadow: 0 14px 40px -10px rgba(215, 255, 58, 0.55);
}
.kx-home .kx-btn--volt:hover .kx-btn-arrow { background: var(--kx-violet); color: #fff; }

.kx-home .kx-btn--ghost {
  --fg: var(--kx-fg);
  --hover-bg: var(--kx-fg);
  border: 1px solid var(--kx-line-strong);
  padding-inline: 28px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.kx-home .kx-btn--ghost .kx-btn-arrow { margin-inline-end: -18px; }
.kx-home .kx-btn--ghost:hover { color: var(--kx-bg); border-color: var(--kx-fg); }

/* CV button rendered by helper */
.kx-home .kx-btn.cv-download-btn { gap: 10px; padding-inline: 22px 26px; }
.kx-home .kx-btn.cv-download-btn .cv-download-btn__icon { display: inline-grid; place-items: center; }
.kx-home .kx-btn.cv-download-btn .cv-download-btn__copy { display: inline-flex; flex-direction: column; line-height: 1.1; }
.kx-home .kx-btn.cv-download-btn .cv-download-btn__copy strong { font-weight: 700; }
.kx-home .kx-btn.cv-download-btn .cv-download-btn__copy small,
.kx-home .kx-btn.cv-download-btn .cv-download-btn__copy span { display: none; }

/* ── Reveal ────────────────────────────────────────── */
.kx-js [data-kx-reveal] {
  opacity: 0;
  transform: translateY(48px);
  filter: blur(8px);
  transition:
    opacity 1.1s var(--kx-ease) var(--rd, 0ms),
    transform 1.1s var(--kx-ease) var(--rd, 0ms),
    filter 1.1s var(--kx-ease) var(--rd, 0ms);
}
.kx-js [data-kx-reveal].is-in { opacity: 1; transform: none; filter: none; }

/* ── Spotlight cards ───────────────────────────────── */
[data-kx-spot] { position: relative; isolation: isolate; }
[data-kx-spot]::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(139, 108, 255, 0.18), transparent 60%);
  transition: opacity 0.4s;
}
[data-kx-spot]:hover::after { opacity: 1; }

/* ═══════════════════════════════════════════════════
   CTA
   ═══════════════════════════════════════════════════ */
.kx-cta {
  position: relative;
  background: var(--kx-volt);
  color: var(--kx-ink);
  padding-block: clamp(40px, 5vw, 70px) clamp(80px, 10vw, 140px);
  overflow: hidden;
  isolation: isolate;
}
.kx-cta-marquee { overflow: hidden; direction: ltr; margin-bottom: clamp(40px, 6vw, 80px); }
.kx-cta-track { display: flex; width: max-content; animation: kx-marquee 38s linear infinite; }
.kx-cta-track > div { display: flex; align-items: center; flex: none; }
.kx-cta-track span {
  font-family: var(--kx-display);
  font-weight: 600;
  font-size: clamp(4rem, 11vw, 11rem);
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
  padding-inline: 0.25em;
}
.kx-cta-track span:nth-of-type(even) { color: transparent; -webkit-text-stroke: 2px var(--kx-ink); }
.kx-cta-track i { font-style: normal; font-size: clamp(2rem, 4vw, 4rem); color: var(--kx-violet); }
html[lang^="ar"] .kx-cta-track span { letter-spacing: 0; }

.kx-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}
.kx-cta .kx-title { color: var(--kx-ink); font-size: clamp(2rem, 4vw, 3.8rem); max-width: 16ch; }
.kx-cta .kx-desc { color: rgba(7, 7, 11, 0.7); margin-top: 18px; font-weight: 500; }

.kx-home .kx-orb-btn {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(170px, 18vw, 230px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--kx-ink);
  color: var(--kx-volt);
  box-shadow: 0 30px 80px rgba(7, 7, 11, 0.35);
  transition: background 0.5s;
}
.kx-orb-btn svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: kx-spin 16s linear infinite;
}
.kx-orb-btn text {
  fill: currentColor;
  font-family: var(--kx-body);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.kx-orb-btn-core {
  display: grid;
  place-items: center;
  width: 44%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--kx-volt);
  color: var(--kx-ink);
  font-size: 2rem;
  transition: transform 0.6s var(--kx-ease), background 0.4s;
}
html[dir="rtl"] .kx-orb-btn-core span { display: inline-block; transform: scaleX(-1); }
.kx-orb-btn:hover { background: var(--kx-violet); }
.kx-orb-btn:hover .kx-orb-btn-core { transform: scale(1.12) rotate(45deg); background: #fff; }


/* pills, chips, tags, action rows */
.kx-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding-block: 9px;
  padding-inline: 14px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.kx-pill-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--kx-volt);
  box-shadow: 0 0 12px var(--kx-volt);
  flex: none;
}
.kx-pill-dot::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid var(--kx-volt);
  animation: kx-ping 2s var(--kx-ease) infinite;
}
@keyframes kx-ping { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes kx-spin { to { rotate: 360deg; } }
@keyframes kx-marquee { to { transform: translateX(-50%); } }
@keyframes kx-scrollshot {
  0%, 8% { transform: translateY(0); }
  92%, 100% { transform: translateY(calc(-100% + 100cqh)); }
}
.kx-actions { display: flex; flex-wrap: wrap; gap: 16px 14px; align-items: center; }
.kx-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.kx-chips li {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(169, 150, 255, 0.35);
  background: rgba(139, 108, 255, 0.12);
  color: var(--kx-accent);
  font-family: var(--kx-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
}
.kx-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.kx-tags li,
.kx-tags span {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--kx-line-strong);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--kx-fg-soft);
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--kx-ease);
}
.kx-tags li:hover,
.kx-tags span:hover { background: var(--kx-volt); color: var(--kx-ink); border-color: var(--kx-volt); transform: translateY(-3px) rotate(-2deg); }

/* softer type */
.kx-title { font-weight: 500; letter-spacing: -0.03em; line-height: 1.05; }
html[lang^="ar"] .kx-title { font-weight: 600; letter-spacing: 0; line-height: 1.3; }

.kx-home .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* The v2 pages run their own entrances; skip the legacy whole-page blur-in on <main>. */
main.kx-home { animation: none !important; filter: none !important; transform: none !important; opacity: 1 !important; }

@media (max-width: 900px) {
  .kx-head--split,
  .kx-cta-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .kx-home *,
  .kx-home *::before,
  .kx-home *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}
