/* =====================================================================
   thejundi.com: /works/ index (builds on /assets/site-chrome.css)
   Two groups: identities (gallery cards) and platforms + agents (screen frames).
   Two blades: hero (gradient), closing call (teal).
   ===================================================================== */

.works-page main { display: block; }

/* ---------------- Intro ---------------- */
.wx-hero { position: relative; padding-top: clamp(40px, 5.2vw, 96px); padding-bottom: clamp(56px, 6vw, 104px); overflow-x: clip; }
.wx-hero__in { position: relative; }
.wx-eyebrow {
  display: flex; align-items: center; gap: 14px; margin: 0 0 clamp(12px, 1.8vw, 24px);
  font-size: 15px; font-weight: 500; line-height: 1.9; color: var(--sc-ink-2);
}
.wx-eyebrow__rule { flex: none; width: 40px; height: 1px; background: var(--sc-violet); }
.wx-title {
  position: relative; z-index: 1; margin: 0; max-width: 12em;
  font-size: clamp(2.125rem, .95rem + 4.7vw, 4.875rem); font-weight: 300; line-height: 1.35; letter-spacing: 0;
}
.wx-title b { font-weight: 700; }
.wx-title__l { display: block; }
.wx-title__dot { color: var(--sc-violet); font-weight: 700; }
.wx-lead { position: relative; z-index: 1; max-width: 38rem; margin-top: clamp(18px, 2vw, 28px); }
.wx-blade { width: clamp(210px, 60vw, 400px); margin: clamp(26px, 5vw, 40px) 0 0; margin-inline: auto calc(-1 * var(--sc-gutter)); }
@media (min-width: 560px) { .wx-title { font-weight: 200; } } /* ExtraLight only at >= 40px */
/* narrow phones: keep each heading line on one line (no lone word) */
@media (max-width: 374px) { .wx-title { font-size: 9vw; } }
@media (min-width: 900px) {
  .wx-blade {
    position: absolute; z-index: 0; margin: 0;
    width: clamp(320px, 36vw, 600px);
    inset-inline-end: calc(-1 * var(--sc-edge) - 2%);
    top: clamp(24px, 3vw, 56px);
  }
}

/* jump links to the two groups */
.wx-jump {
  position: relative; z-index: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: clamp(40px, 4.6vw, 72px) 0 0; padding: 0; list-style: none; border-top: 1px solid var(--sc-ink);
}
.wx-jump li { margin: 0; }
.wx-jump li + li { border-inline-start: 1px solid var(--sc-line); }
.wx-jump__a {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; column-gap: 16px;
  padding: 22px 0 24px; padding-inline-end: 24px; color: inherit; text-decoration: none;
}
.wx-jump li + li .wx-jump__a { padding-inline: 24px 0; }
.wx-jump__n { font-family: var(--sc-lat); font-size: 14px; font-weight: 500; letter-spacing: .14em; line-height: 1.9; color: var(--sc-violet); }
.wx-jump__t { font-size: clamp(18px, 1rem + .4vw, 22px); font-weight: 500; line-height: 1.9; transition: color var(--sc-t) var(--sc-ease); }
.wx-jump__c { font-size: 14px; line-height: 1.9; color: var(--sc-ink-2); white-space: nowrap; }
.wx-jump__c b { margin-inline-end: 2px; font-family: var(--sc-lat); font-size: clamp(30px, 1.2rem + 1.2vw, 40px); font-weight: 300; line-height: 1.2; color: var(--sc-ink); }
.wx-jump__a:hover .wx-jump__t { color: var(--sc-violet); }
.wx-jump__a:focus-visible { outline-offset: 2px; }
@media (max-width: 639px) {
  .wx-jump { grid-template-columns: minmax(0, 1fr); }
  .wx-jump li + li { border-inline-start: 0; border-top: 1px solid var(--sc-line); }
  .wx-jump__a, .wx-jump li + li .wx-jump__a { padding: 16px 0 18px; }
}

/* ---------------- Groups ---------------- */
.wx-group { border-top: 1px solid var(--sc-line); }
.wx-group--tech { background: var(--sc-surface); }

/* card grid: 6 tracks; identities run 2 large / 3 / 2 large / 3 / 2 large, tech runs 2 large / 3 / 3 / 3 */
.wk-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(48px, 4.6vw, 76px) var(--sc-gap);
  margin: 0; padding: 0; list-style: none;
}
.wk { grid-column: span 2; min-width: 0; }
.wk.wk--l { grid-column: span 3; }
@media (max-width: 1099px) {
  .wk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wk, .wk.wk--l { grid-column: auto; }
  .wk.wk--full { grid-column: 1 / -1; }
  .wk.wk--full .wk__stage-view { aspect-ratio: 32 / 10; }
}
@media (max-width: 639px) {
  .wk-grid { grid-template-columns: minmax(0, 1fr); row-gap: 48px; }
  .wk.wk--full { grid-column: auto; }
  .wk.wk--full .wk__stage-view { aspect-ratio: 16 / 10; }
}

.wk__link { display: block; color: inherit; text-decoration: none; }
.wk__link:focus-visible { outline-offset: 6px; }

/* identity media */
.wk__media { position: relative; display: block; margin: 0; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 4px; background: var(--sc-wash-v); }
.wk__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform var(--sc-t-slow) var(--sc-ease); }
.wk__link:hover .wk__media img { transform: scale(1.03); }

/* tech media: screen frame, phone stage, or a small diagram; all three share one height */
.wk .sc-frame { box-shadow: none; transition: box-shadow var(--sc-t-slow) var(--sc-ease), border-color var(--sc-t) var(--sc-ease); }
.wk .sc-frame__view { aspect-ratio: 16 / 10; }
.wk .sc-frame__view img { transition: transform var(--sc-t-slow) var(--sc-ease); }
.wk .sc-frame__bar { height: 34px; }
.wk__link:hover .sc-frame { box-shadow: var(--sc-shadow); border-color: rgba(0, 24, 52, .2); }
.wk__link:hover .sc-frame__view img { transform: scale(1.02); }
/* stage = a 34px band (same as the frame bar) + a 16:10 view, so it lines up with the frames in its row */
.wk__stage {
  display: block; overflow: hidden; border: 1px solid var(--sc-line); border-radius: 10px; background: var(--sc-wash-t);
  transition: box-shadow var(--sc-t-slow) var(--sc-ease), border-color var(--sc-t) var(--sc-ease);
}
.wk__stage::before { content: ""; display: block; height: 34px; }
.wk__stage--v { background: var(--sc-wash-v); }
.wk__link:hover .wk__stage { box-shadow: var(--sc-shadow); border-color: rgba(0, 24, 52, .2); }
.wk__stage-view { position: relative; display: grid; justify-items: center; align-items: start; aspect-ratio: 16 / 10; }
.wk__phone { width: 30%; margin-top: -12px; box-shadow: 0 30px 60px -30px rgba(0, 24, 52, .35); transition: transform var(--sc-t-slow) var(--sc-ease); }
.wk__link:hover .wk__phone { transform: translateY(-6px); }
.wk.wk--full .wk__phone, .wk.wk--l .wk__phone { width: 24%; }

/* diagram cards (agents with no public screen) */
.wk__diag { align-content: center; justify-items: center; gap: clamp(14px, 1.6vw, 22px); padding: 0 18px 34px; }
.wk__glyph { display: grid; place-items: center; width: clamp(52px, 5vw, 68px); aspect-ratio: 1; border-radius: 50%; background: var(--sc-surface); box-shadow: 0 16px 30px -22px rgba(0, 24, 52, .45); }
.wk__glyph svg { width: 52%; height: auto; fill: none; stroke: var(--sc-teal-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wk__stage--v .wk__glyph svg { stroke: var(--sc-violet); }
.wk__steps { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 6px; max-width: 26rem; margin: 0; padding: 0; list-style: none; }
.wk__steps li {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  font-size: 14px; font-weight: 500; line-height: 1.9; color: var(--sc-ink); white-space: nowrap;
}
.wk__steps li span { padding: 2px 12px; background: var(--sc-surface); border: 1px solid var(--sc-line); border-radius: 999px; }
.wk__steps li.is-gate span { border-color: var(--sc-violet-a); color: var(--sc-violet); }
/* the arrow trails each step except the last, so a wrapped row ends with an arrow instead of starting with one */
.wk__steps li:not(:last-child)::after {
  content: ""; flex: none; width: 6px; height: 6px; margin-inline-start: 2px;
  border-top: 1.5px solid var(--sc-ink-3); border-left: 1.5px solid var(--sc-ink-3); transform: rotate(-45deg);
}

/* caption */
.wk__cap { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 8px; align-items: baseline; margin-top: 16px; }
.wk__n { grid-column: 1; grid-row: 1 / span 3; font-family: var(--sc-lat); font-size: 14px; font-weight: 500; letter-spacing: .14em; line-height: 1.9; color: var(--sc-ink-3); transition: color var(--sc-t) var(--sc-ease); }
.wk__kind { grid-column: 2 / -1; margin: 0; font-size: 14px; font-weight: 500; line-height: 1.9; color: var(--sc-teal-ink); }
.wk__title { grid-column: 2; margin: 0; font-size: clamp(19px, 1rem + .4vw, 23px); font-weight: 500; line-height: 1.6; transition: color var(--sc-t) var(--sc-ease); }
.wk__title .sc-lat { font-size: .94em; }
.wk--l .wk__title { font-size: clamp(20px, 1rem + .6vw, 26px); }
.wk__year { grid-column: 3; font-family: var(--sc-lat); font-size: 14px; font-weight: 500; letter-spacing: .06em; line-height: 1.9; color: var(--sc-ink-2); white-space: nowrap; direction: ltr; unicode-bidi: isolate; }
.wk__sub { grid-column: 2 / -1; margin: 2px 0 0; max-width: 34rem; font-size: 15.5px; line-height: 1.9; color: var(--sc-ink-2); }
.wk__sub .sc-lat { font-size: .95em; }
.wk__sub .sc-tag { font-size: 14px; } /* Arabic status note: never below 14px */
.wk__link:hover .wk__title { color: var(--sc-violet); }
.wk__link:hover .wk__n { color: var(--sc-violet); }
@media (max-width: 479px) {
  .wk__cap { grid-template-columns: 34px minmax(0, 1fr) auto; }
}

/* supporting platforms line */
.wx-also { margin-top: clamp(56px, 5.6vw, 88px); padding-top: 26px; border-top: 1px solid var(--sc-rule); font-size: 15px; line-height: 1.95; color: var(--sc-ink-2); }
.wx-also .sc-link { color: var(--sc-ink); text-decoration-color: rgba(0, 24, 52, .28); }
.wx-also .sc-link:hover { color: var(--sc-violet); text-decoration-color: var(--sc-violet); }

/* ---------------- Closing call ---------------- */
.wx-cta { position: relative; padding-block: var(--sc-sec); overflow-x: clip; border-top: 1px solid var(--sc-line); }
.wx-cta__in { position: relative; }
.wx-cta__h { position: relative; z-index: 1; max-width: 14em; font-size: clamp(2rem, 1.05rem + 3.2vw, 4.25rem); font-weight: 300; line-height: 1.35; }
.wx-cta__h b { font-weight: 700; }
.wx-cta__l { display: block; }
.wx-cta__dot { color: var(--sc-violet); font-weight: 700; }
.wx-cta__sub { position: relative; z-index: 1; max-width: 36rem; margin: 22px 0 34px; }
.wx-cta .sc-actions { position: relative; z-index: 1; }
.wx-cta__blade { width: clamp(190px, 52vw, 340px); margin-top: 48px; margin-inline: auto calc(-1 * var(--sc-gutter)); }
@media (min-width: 740px) { .wx-cta__h { font-weight: 200; } } /* >= 40px from 740px */
@media (max-width: 374px) { .wx-cta__h { font-size: 9.3vw; } } /* «نبدأ باستشارة قصيرة.» stays on one line */
@media (min-width: 900px) {
  .wx-cta__blade { position: absolute; z-index: 0; margin: 0; width: clamp(280px, 30vw, 500px); inset-inline-end: calc(-1 * var(--sc-edge) - 2%); bottom: 4px; }
}
@media (max-width: 599px) {
  .wx-cta .sc-actions .sc-btn { flex: 1 1 100%; }
}

/* ---------------- Entrance (first screen only) + reduced motion ---------------- */
@media (prefers-reduced-motion: no-preference) {
  .wx-eyebrow, .wx-title__l, .wx-lead, .wx-jump { animation: wx-rise .65s var(--sc-ease) both; }
  .wx-title__l:nth-child(1) { animation-delay: .05s; }
  .wx-title__l:nth-child(2) { animation-delay: .12s; }
  .wx-lead { animation-delay: .22s; }
  .wx-jump { animation-delay: .3s; }
  .wx-blade { animation: wx-slab .65s var(--sc-ease) .25s both; }
}
@keyframes wx-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes wx-slab { from { opacity: 0; transform: translateX(-8%); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .wk__media img, .wk .sc-frame, .wk .sc-frame__view img, .wk__stage, .wk__phone, .wk__title, .wk__n, .wx-jump__t { transition: none; }
  .wk__link:hover .wk__media img, .wk__link:hover .sc-frame__view img, .wk__link:hover .wk__phone { transform: none; }
}
