/* Work page v2: sand hero with moving strips of real screens, then filterable project cards. Loads after hms-case.css and case-v2.css. */

/* Hero */
.work-hero-copy{display:grid;gap:22px;padding-bottom:40px}
.work-hero-copy>*{margin:0}
.work-eyebrow{display:inline-flex;align-items:center;gap:10px;font-size:14px;color:var(--sand-muted)}
.work-eyebrow:before{content:'';flex:none;width:8px;height:8px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 4px rgba(69,92,233,.16)}
.work-hero h1{font-size:clamp(40px,6.4vw,96px);line-height:1.03;letter-spacing:-.035em;max-width:15ch;text-wrap:balance}
html[data-lang=ar] .work-hero h1{font-size:clamp(36px,5.6vw,84px);letter-spacing:normal;max-width:16ch}
html[data-lang=ar] .work-hero h1 .ar{line-height:1.3}
.work-lead{max-width:58ch;font-size:clamp(17px,1.4vw,20px);line-height:1.6;color:var(--sand-text)}
.work-hero .hero-actions .primary-link{margin:0;min-height:56px;padding:0 20px;gap:10px;background:var(--ink);color:#fff;transition:background .2s}
.work-hero .hero-actions .primary-link:hover{background:var(--accent)}
.work-hero .hero-actions .primary-link .en{font-size:16px}
.work-hero .hero-actions>a{white-space:nowrap}
.work-hero .hero-actions .primary-link:hover svg{transform:translateY(3px)}
.work-hero .hero-facts{max-width:640px;margin-top:6px}
@media(prefers-reduced-motion:no-preference){
  .js .work-eyebrow:before{animation:eyebrow-pulse 2.6s ease-in-out infinite}
  .js .work-hero-copy>*{animation:case-rise .8s cubic-bezier(.2,.7,.2,1) both}
  .js .work-hero-copy>:nth-child(2){animation-delay:.08s}
  .js .work-hero-copy>:nth-child(3){animation-delay:.16s}
  .js .work-hero-copy>:nth-child(4){animation-delay:.24s}
  .js .work-hero-copy>:nth-child(5){animation-delay:.32s}
  .js .screen-strip{animation:case-fade 1s .4s ease both}
}
@keyframes eyebrow-pulse{50%{box-shadow:0 0 0 8px rgba(69,92,233,0)}}
@media(min-width:1040px){
  .work-hero-copy{grid-template-columns:minmax(0,1.25fr) minmax(0,.75fr);column-gap:64px;align-items:end;padding-bottom:56px}
  .work-eyebrow,.work-hero h1{grid-column:1/-1}
  .work-lead{grid-column:1;grid-row:3}
  .work-hero .hero-actions{grid-column:1;grid-row:4;flex:none}
  .work-hero .hero-actions>a{flex:0 0 auto}
  .work-hero .hero-facts{grid-column:2;grid-row:3/span 2;align-self:end}
}

/* Moving strips of real screens (decorative copies of the project list) */
.screen-strip{display:grid;gap:12px;padding-bottom:48px;direction:ltr;-webkit-mask-image:linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent);mask-image:linear-gradient(90deg,transparent,#000 7%,#000 93%,transparent)}
.strip-row{overflow:hidden}
.strip-track{display:flex;width:max-content;animation:strip-move 60s linear infinite}
.strip-row+.strip-row .strip-track{animation-duration:52s;animation-direction:reverse}
.strip-track a{flex:none;width:172px;aspect-ratio:4/3;margin-right:12px;border-radius:10px;overflow:hidden;border:1px solid var(--sand-line);background:#fff;box-shadow:0 12px 26px -18px rgba(28,29,32,.45);transition:transform .3s}
.strip-track img{width:100%;height:100%;object-fit:cover;object-position:top center}
.strip-track a:hover{transform:translateY(-4px)}
.screen-strip:hover .strip-track,.screen-strip.is-paused .strip-track{animation-play-state:paused}
@keyframes strip-move{to{transform:translateX(-50%)}}
@media(min-width:720px){.screen-strip{gap:16px}.strip-track a{width:248px;margin-right:16px;border-radius:12px}}
@media(prefers-reduced-motion:reduce){.strip-track{animation:none}.strip-row{overflow-x:auto;scrollbar-width:none}}

/* Collection */
.work-collection{padding-bottom:var(--section-gap)}
.collection-head{padding-top:64px}
.collection-head h2{max-width:20ch}
.collection-bar{position:sticky;top:0;z-index:5;margin:28px 0 30px;background:rgba(255,255,255,.94);border-block:1px solid var(--line);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
.collection-bar .wrap{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:70px}
.work-filters{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding-block:2px}
.work-filters::-webkit-scrollbar{display:none}
.work-filters button{flex:none;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:0 18px;border:1px solid var(--line);border-radius:40px;background:#fff;color:var(--ink);font-size:15px;transition:border-color .2s,background .2s,color .2s}
.work-filters button:hover{border-color:var(--ink)}
.work-filters button[aria-pressed=true]{background:var(--ink);border-color:var(--ink);color:#fff}
.filter-count{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums;font-family:Portfolio,sans-serif}
.work-filters button[aria-pressed=true] .filter-count{color:#c7c9cd}
#work-count{flex:none;font-size:14px;color:var(--muted)}

.project-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:40px}
.project-card[hidden]{display:none}
.project-card a{display:flex;flex-direction:column;height:100%}
.card-media{position:relative;display:block;aspect-ratio:4/3;overflow:hidden;border-radius:16px;border:1px solid var(--line);background:var(--soft)}
.card-media img{width:100%;height:100%;object-fit:cover;object-position:top center;transition:transform .8s cubic-bezier(.2,.7,.2,1)}
.card-kind{position:absolute;top:12px;inset-inline-start:12px;padding:6px 12px;border-radius:30px;background:rgba(255,255,255,.92);color:var(--ink);font-size:13px;line-height:1.2;box-shadow:0 4px 14px -8px rgba(28,29,32,.35)}
.card-arrow{position:absolute;bottom:12px;inset-inline-end:12px;display:grid;place-items:center;width:46px;height:46px;border-radius:50%;background:var(--ink);color:#fff;transition:background .25s,transform .25s}
.card-arrow svg{width:22px;height:22px}
.card-body{display:grid;gap:8px;padding-top:18px}
.card-top{display:flex;align-items:baseline;gap:10px;font-size:14px;color:var(--muted)}
.card-index{font-family:Portfolio,sans-serif;font-variant-numeric:tabular-nums;color:var(--ink)}
.card-title{font-size:clamp(26px,2.3vw,34px);line-height:1.15;letter-spacing:-.02em}
html[data-lang=ar] .card-title .ar{font-weight:600;line-height:1.35}
.card-line{max-width:52ch;font-size:16px;line-height:1.55;color:#3d3f44}
.card-meta{font-size:14px;color:var(--muted)}
.project-card a:hover .card-media img{transform:scale(1.045)}
.project-card a:hover .card-arrow{background:var(--accent);transform:scale(1.06)}
.project-card a:hover .card-title{color:var(--accent)}
.project-card a:focus-visible{outline-offset:6px;border-radius:16px}
@media(min-width:720px){.project-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:48px 24px}}
@media(min-width:1040px){
  .project-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:56px 28px}
  .project-card{grid-column:span 2}
  .project-card.is-featured{grid-column:span 3}
  .is-featured .card-title{font-size:clamp(30px,2.8vw,44px)}
  .is-featured .card-media{border-radius:20px;aspect-ratio:16/10}
}

/* Cards rise into view once (case-v2 reveal handled by work-v2.js) */
@media(prefers-reduced-motion:no-preference){
  .js .project-card.reveal{opacity:0;transform:translateY(28px);transition:opacity .7s ease,transform .8s cubic-bezier(.2,.7,.2,1)}
  .js .project-card.reveal.is-in{opacity:1;transform:none}
}

/* Contact on the Work page */
.work-collection+.contact-section,main+.contact-section{border-top:1px solid var(--sand-line)}
@media(max-width:719px){
  .collection-head{padding-top:52px}
  .collection-bar{margin:22px 0 26px}
  .collection-bar .wrap{min-height:64px}
  #work-count{display:none}
}
@media print{.screen-strip,.collection-bar,.action-bar{display:none!important}.project-card[hidden]{display:block}.v2-hero{margin-top:0;padding-top:0}}
