/* Work Index: every project in one row that you scroll sideways. */
body.work { background: var(--bg); }
html:has(body.work) { background: var(--bg); }
.work main { background: var(--bg); }

/* header: nav on top, the title sits just above where the cards start */
.wi-head { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: max(300px, calc(54vh - var(--wi-top))); padding: 120px 28px 0; --wi-top: 86px; }
.wi-nav { color: #fff; mix-blend-mode: normal; }
.wi-nav a[aria-current]::after { transform: scaleX(1); }
.wi-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.wi-title h1 { font-weight: 600; font-size: clamp(64px, 10.4vw, 170px); line-height: .9; letter-spacing: -0.055em; margin-left: -.04em; }
.wi-count { color: var(--muted); font-size: 15px; padding-bottom: .6em; white-space: nowrap; }
.wi-hint { display: none; }
.wi-pinned .wi-hint { display: inline; }

/* the track. Default (no JS, phones, reduced motion): a plain vertical list */
.wi { --wi-top: 86px; --wi-bot: 24px; --wi-gap: 12px; }
.wi-track { list-style: none; display: grid; gap: 64px; padding: 48px 28px 96px; }
.wi-item { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--wi-gap); }
.wi-img { position: relative; display: block; overflow: hidden; border-radius: 16px; aspect-ratio: 4 / 3; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; background: #1b1a1a; }
.wi-text { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border: 1px solid var(--rule); border-radius: 12px; padding: 30px 36px; }
.wi-text .mono { color: var(--muted); font-size: 18px; }
.wi-text h2 { margin-top: 22px; font-weight: 600; font-size: clamp(36px, 3.4vw, 62px); line-height: 1; letter-spacing: -0.035em; }
.wi-text p { margin-top: 26px; color: var(--muted); max-width: 34ch; }
.wi-text .ptags { margin-top: auto; padding-top: 28px; border-top: 0; }
.wi-text .ptags li { border-bottom: 1px solid var(--rule); font-weight: 400; }
.wi-text .ptags li:last-child { border-bottom: 0; }
a.wi-text { transition: border-color .3s ease; }
a.wi-text:hover, a.wi-text:focus-visible { border-color: #6b6363; }
a.wi-text:focus-visible, .wi-img:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* image panels */
.wi-img.screen { background: radial-gradient(120% 90% at 20% 15%, #1c2333, #09090b 70%); }
.wi-img.screen img { position: absolute; top: 50%; left: 9%; height: 64%; width: auto; max-width: none; transform: translateY(-50%); border-radius: 10px; border: 1px solid #27272a; box-shadow: 0 40px 80px -24px rgb(0 0 0 / .7); transition: transform 1.1s cubic-bezier(.22,.8,.24,1); }
.wi-img.screen:hover img { transform: translate(-4%, -50%); }
.wi-img.photo { background: #2a2a2a; }
.wi-img.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; transition: transform 1.1s cubic-bezier(.22,.8,.24,1); }
.wi-img.photo:hover img { transform: scale(1.04); }
.wi-img.phones { display: flex; align-items: center; justify-content: center; gap: 4%; background: radial-gradient(120% 90% at 70% 30%, #26201a, #0b0b0d 65%); }
.wi-img.phones img { width: 25%; border-radius: 22px; border: 1px solid #2a2a2f; transition: transform .8s cubic-bezier(.22,.8,.24,1); }
.wi-img.phones img:nth-child(2) { transform: translateY(-36px); }
.wi-img.phones:hover img:nth-child(1) { transform: translateY(-10px) rotate(-3deg); }
.wi-img.phones:hover img:nth-child(3) { transform: translateY(-10px) rotate(3deg); }
.wi-img.paper { display: flex; align-items: center; justify-content: center; padding: 8%; }
.wi-img.paper svg { width: 100%; height: auto; max-height: 100%; transition: transform 1s cubic-bezier(.22,.8,.24,1); }
.wi-img.paper:hover svg { transform: scale(1.04); }
.wi-img.video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* pinned (desktop, motion allowed): cards rise, lock to the baseline, then the row moves sideways */
.wi-pinned .wi-pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; overflow: clip; padding: var(--wi-top) 0 var(--wi-bot); }
.wi-pinned .wi-track { display: flex; gap: 72px; width: max-content; height: 100%; padding: 0 28px; will-change: transform; }
.wi-pinned .wi-item { display: flex; height: 100%; }
.wi-pinned .wi-img { aspect-ratio: auto; height: 100%; width: min(62vw, calc((100vh - 110px) * .84)); }
.wi-pinned .wi-text { height: 100%; width: clamp(360px, 29vw, 500px); }
.wi-bar { display: none; }
.wi-pinned .wi-bar { display: block; position: absolute; left: 28px; right: 28px; bottom: 9px; height: 2px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.wi-pinned .wi-bar i { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* footer */
.wi-foot { padding: 40px 28px 28px; border-top: 1px solid var(--rule); background: var(--bg); }
.wi-talk { display: inline-flex; align-items: baseline; gap: .2em; font-weight: 600; font-size: clamp(56px, 9vw, 150px); line-height: 1; letter-spacing: -0.05em; transition: color .3s ease; }
.wi-talk:hover { color: var(--accent); }
.wi-talk span { font-size: .5em; }
.wi-foot-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin-top: 56px; }
.wi-foot dl { display: grid; gap: 14px; }
.wi-foot dt { font-size: 14px; color: var(--muted); }
.wi-foot dd { font-size: 20px; font-weight: 500; }
.wi-foot ul { list-style: none; display: flex; gap: 28px; font-size: 20px; font-weight: 500; }
.wi-foot ul a, .wi-foot dd a { position: relative; }
.wi-foot ul a::after, .wi-foot dd a::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.wi-foot ul a:hover::after, .wi-foot dd a:hover::after { transform: scaleX(1); }
.wi-legal { margin-top: 40px; font-size: 13px; color: var(--muted); }

@media (max-width: 900px) {
  .wi-item { grid-template-columns: 1fr; }
  .wi-text { padding: 22px; }
  .wi-text p { display: block; }
  .wi-text .ptags { margin-top: 0; padding-top: 22px; }
  .wi-text .ptags li { border: 0; padding: 0; color: var(--muted); }
  .wi-img.screen img { height: 72%; left: 7%; }
}
@media (max-width: 760px) {
  .wi-head { min-height: 0; padding: 140px 16px 0; }
  .wi-nav { padding: 18px 16px; }
  .wi-title { flex-direction: column; align-items: flex-start; gap: 14px; }
  .wi-title h1 { font-size: clamp(56px, 17vw, 96px); }
  .wi-count { padding-bottom: 0; }
  .wi-track { padding: 32px 12px 64px; gap: 40px; }
  .wi-img.phones img { border-radius: 12px; }
  .wi-img.phones img:nth-child(2) { transform: translateY(-16px); }
  .wi-text h2 { font-size: 34px; margin-top: 14px; }
  .wi-text p { margin-top: 14px; font-size: 16px; }
  .wi-foot { padding: 32px 16px 24px; }
  .wi-foot ul { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .wi-img.screen img, .wi-img.phones img, .wi-img.paper svg { transition: none; }
}
