.work-gallery { position:relative; z-index:3; height:calc(var(--count) * 100svh); background:#f5f5f5; color:#1d1d1f; }
.work-pin { position:sticky; top:0; height:100svh; display:grid; grid-template-columns:39.03% minmax(0,1fr); }
.work-panel { padding:clamp(68px,10vh,92px) clamp(24px,4vw,64px) 24px; display:flex; flex-direction:column; overflow:auto; }
.work-panel h2 { font-size:15px; font-weight:500; margin:0; }
.work-list { margin:24px 0; }
.work-item { border-top:1px solid #1d1d1f24; }
.work-item:last-child { border-bottom:1px solid #1d1d1f24; }
.work-row { width:100%; display:grid; grid-template-columns:32px 1fr auto; gap:4px; align-items:baseline; padding:clamp(8px,1.7vh,16px) 0; border:0; background:none; color:#646466; cursor:pointer; font:inherit; text-align:left; }
.work-row span { font-size:clamp(20px,1.6vw,25px); transition:transform .18s; }
.work-row:is(:hover,[aria-expanded=true]) { color:#1d1d1f; }
.work-row[aria-expanded=true] span { font-weight:500; }
.work-row:hover span { transform:translateX(4px); }
.work-gallery small,.work-count { font-size:13px; font-variant-numeric:tabular-nums; }
.work-detail { display:grid; grid-template-rows:1fr; transition:grid-template-rows .28s ease,opacity .2s; }
.work-detail[inert] { grid-template-rows:0fr; opacity:0; }
.work-detail > div { min-height:0; overflow:hidden; padding-inline-start:36px; }
.work-detail p { font-size:clamp(16px,1.3vw,17.3px); line-height:1.5; color:#565658; max-width:36ch; margin:0 0 14px; }
.work-detail small { display:block; margin-bottom:12px; }
.work-case { display:inline-flex; align-items:center; padding:8px 16px; font-size:15px; line-height:20px; background:white; color:#1d1d1f; border:1px solid #dcdcdc; border-radius:99px; text-decoration:none; }
.work-detail .work-case { margin-bottom:16px; }
.work-lab { grid-area:1 / 1 / 2 / -1; border-top:1px solid #1d1d1f24; text-decoration:none; }
.work-dock { display:grid; margin-top:auto; gap:8px; }
.work-track { height:2px; background:#1d1d1f26; grid-row:2; }
.work-track i { display:block; height:100%; background:currentColor; transform:scaleX(var(--progress,0)); transform-origin:left; }
.work-media { min-width:0; min-height:0; position:relative; }
.work-rail { position:absolute; inset:0; overflow:hidden; }
.work-slide { position:relative; height:100%; width:100%; overflow:hidden; }
.work-slide > img { width:100%; height:100%; display:block; object-fit:cover; }
.work-frame-link { position:absolute; inset:0; }
.work-arrows,.work-caption { display:none; }
@media (width > 760px) and (not ((hover:none) and (orientation:landscape) and (max-height:540px))) {
  .work-rail { isolation:isolate; }
  .work-slide { position:absolute; inset:0; opacity:0; }
  .work-slide[data-visible=true] { z-index:1; opacity:1; }
}
@media (width > 760px) and (not ((hover:none) and (orientation:landscape) and (max-height:540px))) and (prefers-reduced-motion:no-preference) {
  /* Keep the outgoing cover opaque underneath until the incoming cover fills the frame. */
  .work-slide { transition:opacity 320ms step-end; }
  .work-slide[data-visible=true] { transition:opacity 320ms cubic-bezier(.16,1,.3,1); }
}
@media (max-width:760px), (hover:none) and (orientation:landscape) and (max-height:540px) {
  .work-gallery,.work-pin { height:max(300px,100svh); }
  .work-pin { position:relative; display:block; }
  .work-panel { display:contents; }
  .work-lab { grid-area:1 / 3; justify-self:end; display:flex; align-items:center; width:auto; min-height:44px; padding:0; border:0; color:white; pointer-events:auto; }
  .work-lab > :not(:last-child) { display:none; }
  .work-lab > small:last-child { font-size:15px; }
  .work-lab::after { content:"↗"; }
  .work-count { grid-area:1 / 2; justify-self:start; margin-left:10px; }
  .work-lab:is(:hover,:focus-visible) { color:white; }
  .work-media { height:100%; }
  .work-panel h2 { position:absolute; top:64px; left:20px; z-index:2; font-size:13px; color:white; pointer-events:none; }
  .work-gallery .work-list,.work-frame-link { display:none; }
  .work-rail { display:flex; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; }
  .work-slide { flex:0 0 100%; scroll-snap-align:start; }
  .work-slide::after { position:absolute; inset:0; content:""; pointer-events:none; background:linear-gradient(to bottom,#0009,rgba(0,0,0,.4) 125px,transparent 40%),linear-gradient(to top,#000a,transparent 150px); }
  .work-slide[data-project=ken-block] img { object-position:32% center!important; }
  .work-slide[data-project=cozy-life] img { object-fit:contain; background:#fff; }
  .work-caption { display:block; position:absolute; inset:0; color:white; z-index:1; pointer-events:none; opacity:var(--alpha,1); transform:translateY(var(--drift,0)); }
  .work-caption header { position:absolute; top:84px; left:20px; right:20px; display:flex; align-items:baseline; justify-content:space-between; }
  .work-caption h3 { font-size:clamp(33px,9vw,45px); line-height:1.12; letter-spacing:-.035em; font-weight:500; margin:0; }
  .work-caption .work-case { position:absolute; bottom:calc(72px + env(safe-area-inset-bottom)); left:20px; min-height:44px; pointer-events:auto; }
  .work-dock { position:absolute; bottom:max(16px,env(safe-area-inset-bottom)); left:20px; right:20px; z-index:2; color:white; grid-template-columns:auto 1fr auto; gap:0; align-items:center; pointer-events:none; }
  .work-arrows { grid-area:1 / 1; display:flex; margin-left:-12px; }
  .work-arrows button { width:44px; height:44px; pointer-events:auto; color:white; background:none; border:0; font-size:20px; }
  .work-arrows button:disabled { opacity:.35; }
  .work-track { grid-area:2 / 1 / 3 / -1; background:#ffffff80; }
  .work-in-view .header-contact-pill { display:none!important; }
  .work-in-view .site-header__bg { opacity:0!important; }
  .work-in-view .site-header:not(:has([aria-expanded="true"])) .brand-logo { color:white; }
  .work-in-view .site-header:not(:has([aria-expanded="true"])) .header-menu-btn__dots span { background:white; }
}
@media(prefers-reduced-motion:reduce) {
 .work-gallery * { transition:none!important; }
 .work-caption,.work-row:hover span { transform:none; }
}

.work-slide[data-project="ton-foundation"] > img,
.work-hover[src$="/ton-silver-coins-gray.webp"],
.projects-media-placeholder__image[src$="/ton-silver-coins-gray.webp"] {
  object-fit: contain;
  object-position: center;
  background: #a3a3a3;
}

@media (max-width: 760px) {
  .work-slide[data-project="ton-foundation"] > img {
    box-sizing: border-box;
    padding-block: clamp(130px, 18svh, 168px) clamp(106px, 14svh, 140px);
  }
}

@media (orientation: landscape) and (max-height: 540px) and (hover: none) {
  .work-slide[data-project="ton-foundation"] > img {
    box-sizing: border-box;
    padding: 8px 0 8px 40%;
  }
}
